diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-09 23:45:27 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-09 23:45:27 +0400 |
commit | d091856486cffc4351d6ded86de3c33afb3155b4 (patch) | |
tree | 6188adcf6f80afcdac4f41cc9733ac5853443e02 /release | |
parent | a2a04bab8ae70b2f665eb308a62e15d31e88de87 (diff) |
2.5: Buttons Window
* Fix poll() callback changes in recent commit, note that these have
to work with pinned context too.
* Hide header for context panels in py layout.
* Don't jump back when collapsing a panel, allow the view to be
over some empty space until you scroll back.
* Fix follow context icon, order had to be reversed in icon file.
* ID template now has icon as part of browse button instead of
outside the buttons.
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/buttons_data_armature.py | 8 | ||||
-rw-r--r-- | release/ui/buttons_data_bone.py | 2 | ||||
-rw-r--r-- | release/ui/buttons_data_camera.py | 8 | ||||
-rw-r--r-- | release/ui/buttons_data_curve.py | 12 | ||||
-rw-r--r-- | release/ui/buttons_data_lamp.py | 6 | ||||
-rw-r--r-- | release/ui/buttons_data_lattice.py | 6 | ||||
-rw-r--r-- | release/ui/buttons_data_mesh.py | 6 | ||||
-rw-r--r-- | release/ui/buttons_data_text.py | 10 | ||||
-rw-r--r-- | release/ui/buttons_material.py | 19 | ||||
-rw-r--r-- | release/ui/buttons_objects.py | 4 | ||||
-rw-r--r-- | release/ui/buttons_texture.py | 27 | ||||
-rw-r--r-- | release/ui/buttons_world.py | 2 |
12 files changed, 42 insertions, 68 deletions
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 7db2419fa9c..adca70e90dd 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -11,11 +11,8 @@ class DataButtonsPanel(bpy.types.Panel): class DATA_PT_context_arm(DataButtonsPanel): __idname__ = "DATA_PT_context_arm" - __label__ = " " + __no_header__ = True - def poll(self, context): - return ((context.object and context.object.type == 'ARMATURE') or context.armature) - def draw(self, context): layout = self.layout @@ -36,9 +33,6 @@ class DATA_PT_skeleton(DataButtonsPanel): __idname__ = "DATA_PT_skeleton" __label__ = "Skeleton" - def poll(self, context): - return ((context.object and context.object.type == 'ARMATURE') or context.armature) - def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index b9130be9367..98c7f2f8e54 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -11,7 +11,7 @@ class BoneButtonsPanel(bpy.types.Panel): class BONE_PT_context_bone(BoneButtonsPanel): __idname__ = "BONE_PT_context_bone" - __label__ = " " + __no_header__ = True def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index b4b53f1c5a1..f583f9679bc 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -11,11 +11,8 @@ class DataButtonsPanel(bpy.types.Panel): class DATA_PT_context_camera(DataButtonsPanel): __idname__ = "DATA_PT_context_camera" - __label__ = " " + __no_header__ = True - def poll(self, context): - return (context.object.type == 'CAMERA') - def draw(self, context): layout = self.layout @@ -28,7 +25,7 @@ class DATA_PT_context_camera(DataButtonsPanel): if ob: split.template_ID(ob, "data") split.itemS() - elif arm: + elif cam: split.template_ID(space, "pin_id") split.itemS() @@ -97,3 +94,4 @@ class DATA_PT_camera_display(DataButtonsPanel): bpy.types.register(DATA_PT_context_camera) bpy.types.register(DATA_PT_camera) bpy.types.register(DATA_PT_camera_display) + diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py index 6e46bf61f53..04c4cd6d01e 100644 --- a/release/ui/buttons_data_curve.py +++ b/release/ui/buttons_data_curve.py @@ -9,14 +9,10 @@ class DataButtonsPanel(bpy.types.Panel): def poll(self, context): return (context.object and context.object.type == 'CURVE' and context.curve) - class DATA_PT_context_curve(DataButtonsPanel): __idname__ = "DATA_PT_context_curve" - __label__ = " " + __no_header__ = True - def poll(self, context): - return (context.object and context.object.type == 'CURVE') - def draw(self, context): layout = self.layout @@ -38,9 +34,6 @@ class DATA_PT_shape_curve(DataButtonsPanel): __idname__ = "DATA_PT_shape_curve" __label__ = "Shape" - def poll(self, context): - return (context.object and context.object.type == 'CURVE') - def draw(self, context): layout = self.layout @@ -48,8 +41,6 @@ class DATA_PT_shape_curve(DataButtonsPanel): curve = context.curve space = context.space_data - - if curve: layout.itemR(curve, "curve_2d") @@ -163,3 +154,4 @@ bpy.types.register(DATA_PT_shape_curve) bpy.types.register(DATA_PT_geometry_curve) bpy.types.register(DATA_PT_pathanim) bpy.types.register(DATA_PT_current_curve) + diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index e6e870bad5d..e56f19b1dec 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -21,11 +21,8 @@ class DATA_PT_preview(DataButtonsPanel): class DATA_PT_context_lamp(DataButtonsPanel): __idname__ = "DATA_PT_context_lamp" - __label__ = " " + __no_header__ = True - def poll(self, context): - return (context.object.type == 'LAMP') - def draw(self, context): layout = self.layout @@ -258,3 +255,4 @@ bpy.types.register(DATA_PT_shadow) bpy.types.register(DATA_PT_sunsky) bpy.types.register(DATA_PT_spot) bpy.types.register(DATA_PT_falloff_curve) + diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index e9c17839abd..dfb429af29d 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -11,11 +11,8 @@ class DataButtonsPanel(bpy.types.Panel): class DATA_PT_context_lattice(DataButtonsPanel): __idname__ = "DATA_PT_context_lattice" - __label__ = " " + __no_header__ = True - def poll(self, context): - return (context.object and context.object.type == 'LATTICE') - def draw(self, context): layout = self.layout @@ -60,3 +57,4 @@ class DATA_PT_lattice(DataButtonsPanel): bpy.types.register(DATA_PT_context_lattice) bpy.types.register(DATA_PT_lattice) + diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index d8ffac6e859..85ce15ef970 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -11,11 +11,8 @@ class DataButtonsPanel(bpy.types.Panel): class DATA_PT_context_mesh(DataButtonsPanel): __idname__ = "DATA_PT_context_mesh" - __label__ = " " + __no_header__ = True - def poll(self, context): - return (context.object and context.object.type == 'MESH') - def draw(self, context): layout = self.layout @@ -218,3 +215,4 @@ bpy.types.register(DATA_PT_vertex_groups) bpy.types.register(DATA_PT_shape_keys) bpy.types.register(DATA_PT_uv_texture) bpy.types.register(DATA_PT_vertex_colors) + diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index b8b0e324609..81d54af0ef7 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -8,14 +8,10 @@ class DataButtonsPanel(bpy.types.Panel): def poll(self, context): return (context.object and context.object.type == 'TEXT' and context.curve) - + class DATA_PT_context_text(DataButtonsPanel): __idname__ = "DATA_PT_context_text" - __label__ = " " - - def poll(self, context): - ob = context.object - return (context.object and context.object.type == 'TEXT') + __no_header__ = True def draw(self, context): layout = self.layout @@ -33,7 +29,6 @@ class DATA_PT_context_text(DataButtonsPanel): split.template_ID(space, "pin_id") split.itemS() - class DATA_PT_shape_text(DataButtonsPanel): __idname__ = "DATA_PT_shape_text" __label__ = "Shape Text" @@ -163,3 +158,4 @@ bpy.types.register(DATA_PT_geometry_text) bpy.types.register(DATA_PT_font) bpy.types.register(DATA_PT_paragraph) #bpy.types.register(DATA_PT_textboxes) + diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index ede28e6fb54..9298b2d2248 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -21,7 +21,7 @@ class MATERIAL_PT_preview(MaterialButtonsPanel): class MATERIAL_PT_context_material(MaterialButtonsPanel): __idname__= "MATERIAL_PT_context_material" - __label__ = " " + __no_header__ = True def poll(self, context): return (context.object) @@ -34,13 +34,14 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): slot = context.material_slot space = context.space_data - row = layout.row() + if ob: + row = layout.row() - row.template_list(ob, "materials", ob, "active_material_index") + row.template_list(ob, "materials", ob, "active_material_index") - col = row.column(align=True) - col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="") - col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") + col = row.column(align=True) + col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="") + col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") split = layout.split(percentage=0.65) @@ -188,11 +189,9 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): split.active = mat.shadeless== False sub = split.column() if mat.diffuse_shader == 'OREN_NAYAR': - sub.itemR(mat, "roughness") - sub = split.column() + sub.itemR(mat, "roughness") if mat.diffuse_shader == 'MINNAERT': sub.itemR(mat, "darkness") - sub = split.column() if mat.diffuse_shader == 'TOON': sub.itemR(mat, "diffuse_toon_size", text="Size") sub = split.column() @@ -232,13 +231,13 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): sub = split.column() if mat.spec_shader in ('COOKTORR', 'PHONG'): sub.itemR(mat, "specular_hardness", text="Hardness") - sub = split.column() if mat.spec_shader == 'BLINN': sub.itemR(mat, "specular_hardness", text="Hardness") sub = split.column() sub.itemR(mat, "specular_ior", text="IOR") if mat.spec_shader == 'WARDISO': sub.itemR(mat, "specular_slope", text="Slope") + sub = split.column() sub.itemR(mat, "specular_hardness", text="Hardness") if mat.spec_shader == 'TOON': sub.itemR(mat, "specular_toon_size", text="Size") diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py index b993d789ac4..59e19d05959 100644 --- a/release/ui/buttons_objects.py +++ b/release/ui/buttons_objects.py @@ -8,7 +8,7 @@ class ObjectButtonsPanel(bpy.types.Panel): class OBJECT_PT_context_object(ObjectButtonsPanel): __idname__ = "OBJECT_PT_context_object" - __label__ = " " + __no_header__ = True def draw(self, context): layout = self.layout @@ -141,4 +141,4 @@ bpy.types.register(OBJECT_PT_transform) bpy.types.register(OBJECT_PT_groups) bpy.types.register(OBJECT_PT_display) bpy.types.register(OBJECT_PT_duplication) -bpy.types.register(OBJECT_PT_animation)
\ No newline at end of file +bpy.types.register(OBJECT_PT_animation) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 6c3ae9412b7..2aea2b478be 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -21,7 +21,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel): class TEXTURE_PT_context_texture(TextureButtonsPanel): __idname__= "TEXTURE_PT_context_texture" - __label__ = " " + __no_header__ = True def poll(self, context): return (context.material or context.world or context.lamp) @@ -36,18 +36,19 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): space = context.space_data slot = context.texture_slot - row = layout.row() - if ma: - row.template_list(ma, "textures", ma, "active_texture_index") - elif la: - row.template_list(la, "textures", la, "active_texture_index") - elif wo: - row.template_list(wo, "textures", wo, "active_texture_index") - """if ma or la or wo: - col = row.column(align=True) - col.itemO("TEXTURE_OT_new", icon="ICON_ZOOMIN", text="") - #col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") - """ + if ma or la or wo: + row = layout.row() + if ma: + row.template_list(ma, "textures", ma, "active_texture_index") + elif la: + row.template_list(la, "textures", la, "active_texture_index") + elif wo: + row.template_list(wo, "textures", wo, "active_texture_index") + """if ma or la or wo: + col = row.column(align=True) + col.itemO("TEXTURE_OT_new", icon="ICON_ZOOMIN", text="") + #col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="") + """ split = layout.split(percentage=0.65) diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index c93e37a0c6a..e8b2656dea1 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -19,7 +19,7 @@ class WORLD_PT_preview(WorldButtonsPanel): layout.template_preview(world) class WORLD_PT_context_world(WorldButtonsPanel): - __label__ = " " + __no_header__ = True def poll(self, context): return (context.scene != None) |