UI tweaks
authorWilliam Reynish <william@reynish.com>
Sat, 3 Oct 2009 11:19:14 +0000 (11:19 +0000)
committerWilliam Reynish <william@reynish.com>
Sat, 3 Oct 2009 11:19:14 +0000 (11:19 +0000)
*Fixed some spacing issues in 3D View and Outliner headers
*Made the Bone properties layout consistent with Object properties
*Put Rotation Mode menus below transformation channels, being less important.
*Tiny layout tweak for area lamps

release/scripts/ui/buttons_data_bone.py
release/scripts/ui/buttons_data_lamp.py
release/scripts/ui/buttons_object.py
source/blender/editors/space_outliner/outliner_header.c
source/blender/editors/space_view3d/view3d_header.c

index 12db3e7277ddaa3835bf3d606aa58366121ee631..e8041cc7393b3c52de88be4da29f5db692d8050c 100644 (file)
@@ -48,7 +48,7 @@ class BONE_PT_transform(BoneButtonsPanel):
                else:
                        pchan = ob.pose.pose_channels[context.bone.name]
 
-                       layout.itemR(pchan, "rotation_mode")
+                       
 
                        row = layout.row()
                        col = row.column()
@@ -67,6 +67,8 @@ class BONE_PT_transform(BoneButtonsPanel):
                                col.itemR(pchan, "rotation_euler", text="Rotation")
 
                        row.column().itemR(pchan, "scale")
+                       
+                       layout.itemR(pchan, "rotation_mode")
                                
 class BONE_PT_transform_locks(BoneButtonsPanel):
        __label__ = "Transform Locks"
@@ -98,8 +100,8 @@ class BONE_PT_transform_locks(BoneButtonsPanel):
                
                row.column().itemR(pchan, "lock_scale")
 
-class BONE_PT_bone(BoneButtonsPanel):
-       __label__ = "Bone"
+class BONE_PT_relations(BoneButtonsPanel):
+       __label__ = "Relations"
 
        def draw(self, context):
                layout = self.layout
@@ -115,7 +117,17 @@ class BONE_PT_bone(BoneButtonsPanel):
                        pchan = ob.pose.pose_channels[context.bone.name]
 
                split = layout.split()
-
+               
+               col = split.column()
+               col.itemL(text="Layers:")
+               col.itemR(bone, "layer", text="")
+               
+               col.itemS()
+               
+               if ob and pchan:
+                       col.itemL(text="Bone Group:")
+                       col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
+               
                col = split.column()
                col.itemL(text="Parent:")
                if context.bone:
@@ -123,32 +135,47 @@ class BONE_PT_bone(BoneButtonsPanel):
                else:
                        col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
                
-               row = col.row()
-               row.active = bone.parent != None
-               row.itemR(bone, "connected")
+               sub = col.column()
+               sub.active = bone.parent != None
+               sub.itemR(bone, "connected")
+               sub.itemR(bone, "hinge", text="Inherit Rotation")
+               sub.itemR(bone, "inherit_scale", text="Inherit Scale")
+
+                       
+class BONE_PT_display(BoneButtonsPanel):
+       __label__ = "Display"
+       
+       def poll(self, context):
+               return context.bone
+       
+       def draw(self, context):
+               layout = self.layout
                
-               col.itemL(text="Layers:")
-               col.itemR(bone, "layer", text="")
+               ob = context.object
+               bone = context.bone
+               arm = context.armature
                
-               col = split.column()
-               col.itemL(text="Inherit:")
-               col.itemR(bone, "hinge", text="Rotation")
-               col.itemR(bone, "inherit_scale", text="Scale")
-               col.itemL(text="Display:")
-               col.itemR(bone, "draw_wire", text="Wireframe")
-               col.itemR(bone, "hidden", text="Hide")
+               if not bone:
+                       bone = context.edit_bone
+                       pchan = None
+               else:
+                       pchan = ob.pose.pose_channels[context.bone.name]
                
                if ob and pchan:
-                       split = layout.split()
                        
+                       split = layout.split()
+               
                        col = split.column()
-                       col.itemL(text="Bone Group:")
-                       col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
+                       
+                       col.itemR(bone, "draw_wire", text="Wireframe")
+                       col.itemR(bone, "hidden", text="Hide")
                        
                        col = split.column()
+                       
                        col.itemL(text="Custom Shape:")
                        col.itemR(pchan, "custom_shape", text="")
 
+
 class BONE_PT_deform(BoneButtonsPanel):
        __label__ = "Deform"
        __default_closed__ = True
@@ -201,5 +228,6 @@ class BONE_PT_deform(BoneButtonsPanel):
 bpy.types.register(BONE_PT_context_bone)
 bpy.types.register(BONE_PT_transform)
 bpy.types.register(BONE_PT_transform_locks)
-bpy.types.register(BONE_PT_bone)
+bpy.types.register(BONE_PT_relations)
+bpy.types.register(BONE_PT_display)
 bpy.types.register(BONE_PT_deform)
index 86ca5beb9b5d28ec0d5bb03d57c6c6c1ba82df8b..2879da8d8d573cd5b02f4e42feb82c8079078a63 100644 (file)
@@ -249,7 +249,7 @@ class DATA_PT_area(DataButtonsPanel):
                split = layout.split()
                
                col = split.column()
-               col.itemR(lamp, "shape", text="")
+               col.row().itemR(lamp, "shape", expand=True)
                
                sub = col.column(align=True)
                if (lamp.shape == 'SQUARE'):
@@ -273,9 +273,9 @@ class DATA_PT_spot(DataButtonsPanel):
                split = layout.split()
                
                col = split.column()
-               sub = col.column(align=True)
+               sub = col.column()
                sub.itemR(lamp, "spot_size", text="Size")
-               sub.itemR(lamp, "spot_blend", text="Blend")
+               sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
                col.itemR(lamp, "square")
                
                col = split.column()
index c069572aa2807d518daa72135ffb3c40382271f5..d546ddb8fd898dce18c9186f022218962c91cdf5 100644 (file)
@@ -26,7 +26,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
                
                ob = context.object
                
-               layout.itemR(ob, "rotation_mode")
+               
 
                row = layout.row()
                
@@ -43,6 +43,8 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
                        
                row.column().itemR(ob, "scale")
                
+               layout.itemR(ob, "rotation_mode")
+               
 class OBJECT_PT_transform_locks(ObjectButtonsPanel):
        __label__ = "Transform Locks"
        __default_closed__ = True
index d4eeaabd1d3a3ed793f01ba3d898f4c23e06715b..b60cc0758692a6cc72cd71bb2339e28225c8344c 100644 (file)
@@ -228,7 +228,7 @@ void outliner_header_buttons(const bContext *C, ARegion *ar)
                xco += xmax;
                
                /* header text */
-               xco += XIC*2;
+               xco += XIC;
                
                uiBlockSetEmboss(block, UI_EMBOSS);
        }
index 45828d654aadd1fc755eaeff7fb81adb0ec01f6c..19c48bb5006c835aeb08467d8094da237062373f 100644 (file)
@@ -2128,7 +2128,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                                xco+= XIC+10;
                        }
                        uiBlockEndAlign(block);
-                       header_xco_step(ar, &xco, &yco, &maxco, XIC+10);
+                       header_xco_step(ar, &xco, &yco, &maxco, 10);
                }
 
                /* Snap */
@@ -2147,7 +2147,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                                uiDefIconTextButS(block, ICONTEXTROW,B_REDR, ICON_SNAP_VERTEX, snapmode_pup(), xco,yco,XIC+10,YIC, &(ts->snap_mode), 0.0, 0.0, 0, 0, "Snapping mode");
                                xco+= XIC;
                                uiDefButS(block, MENU, B_NOP, "Snap Mode%t|Closest%x0|Center%x1|Median%x2|Active%x3",xco,yco,70,YIC, &ts->snap_target, 0, 0, 0, 0, "Snap Target Mode");
-                               xco+= XIC+70;
+                               xco+= XIC;
                        } else {
                                uiDefIconButBitS(block, TOG, SCE_SNAP, B_REDR, ICON_SNAP_GEAR,xco,yco,XIC,YIC, &ts->snap_flag, 0, 0, 0, 0, "Snap while Ctrl is held during transform (Shift Tab)");     
                                xco+= XIC;
@@ -2169,10 +2169,11 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                        uiDefIconButBitS(block, TOG, SCE_SELECT_FACE, B_SEL_FACE, ICON_FACESEL, xco,yco,XIC,YIC, &em->selectmode, 1.0, 0.0, 0, 0, "Face select mode (Ctrl Tab 3)");
                        xco+= XIC;
                        uiBlockEndAlign(block);
+                       header_xco_step(ar, &xco, &yco, &maxco, 10);
                        if(v3d->drawtype > OB_WIRE) {
                                uiDefIconButBitS(block, TOG, V3D_ZBUF_SELECT, B_REDR, ICON_ORTHO, xco,yco,XIC,YIC, &v3d->flag, 1.0, 0.0, 0, 0, "Occlude background geometry");
-                               xco+= XIC;
                        }
+                       xco+= XIC;
                        uiBlockEndAlign(block);
                        header_xco_step(ar, &xco, &yco, &maxco, XIC);