Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-16 16:17:58 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-16 16:17:58 +0400
commit26a8c63eae9c398ad82122877f0ea3d9b167d66c (patch)
tree006a2d4025ecfc4275cf0aef05dabd7c8b7b6812 /release/ui
parentdb7d0108c20332fc55c637e979c65cf55ca37428 (diff)
UI:
* Don't call generic layout hints templates anymore, i.e. TemplateRow becomes Row, etc. * Added more general layout nesting, using uiLayoutSplit() and uiLayoutBox() functions, for which the sublayouts can then be accessed using uiLayoutSub(), to put items in those sublayouts. * Some steps to make the layout decisions, like which items to put in which columns, independent of the width of the window or the text in the buttons. We want the layout to be stable under resizes and translations. * Added an "expand" parameter to uiItemR, used now to expand enums into a row instead of using a menu.
Diffstat (limited to 'release/ui')
-rw-r--r--release/ui/buttons_objects.py58
-rw-r--r--release/ui/buttons_scene.py30
2 files changed, 45 insertions, 43 deletions
diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py
index e760247b0c5..a8cfa40f253 100644
--- a/release/ui/buttons_objects.py
+++ b/release/ui/buttons_objects.py
@@ -11,7 +11,7 @@ class OBJECT_PT_transform(bpy.types.Panel):
if not ob:
return
- layout.template_row()
+ layout.row()
layout.itemR(ob, "location")
layout.itemR(ob, "rotation")
layout.itemR(ob, "scale")
@@ -27,24 +27,24 @@ class OBJECT_PT_groups(bpy.types.Panel):
if not ob:
return
- layout.template_row()
+ layout.row()
layout.itemR(ob, "pass_index")
layout.itemR(ob, "parent")
- # layout.template_left_right()
+ # layout.left_right()
# layout.itemO("OBJECT_OT_add_group");
for group in bpy.data.groups:
if ob in group.objects:
- sublayout = layout.template_stack()
+ sub = layout.box()
- sublayout.template_left_right()
- sublayout.itemR(group, "name")
- # sublayout.itemO("OBJECT_OT_remove_group")
+ sub.split(number=2, lr=True)
+ sub.sub(0).itemR(group, "name")
+ # sub.sub(1).itemO("OBJECT_OT_remove_group")
- sublayout.template_row()
- sublayout.itemR(group, "layer")
- sublayout.itemR(group, "dupli_offset")
+ sub.row()
+ sub.itemR(group, "layer")
+ sub.itemR(group, "dupli_offset")
class OBJECT_PT_display(bpy.types.Panel):
__label__ = "Display"
@@ -57,11 +57,11 @@ class OBJECT_PT_display(bpy.types.Panel):
if not ob:
return
- layout.template_row()
+ layout.row()
layout.itemR(ob, "max_draw_type", text="Type")
layout.itemR(ob, "draw_bounds_type", text="Bounds")
- layout.template_column_flow(2)
+ layout.column_flow()
layout.itemR(ob, "draw_name", text="Name")
layout.itemR(ob, "draw_axis", text="Axis")
layout.itemR(ob, "draw_wire", text="Wire")
@@ -80,11 +80,11 @@ class OBJECT_PT_duplication(bpy.types.Panel):
if not ob:
return
- layout.template_column()
- layout.itemR(ob, "dupli_type", text="")
+ layout.column()
+ layout.itemR(ob, "dupli_type", text="", expand=True)
if ob.dupli_type == "FRAMES":
- layout.template_column_flow(2)
+ layout.column_flow()
layout.itemR(ob, "dupli_frames_start", text="Start:")
layout.itemR(ob, "dupli_frames_end", text="End:")
layout.itemR(ob, "dupli_frames_on", text="On:")
@@ -101,21 +101,23 @@ class OBJECT_PT_animation(bpy.types.Panel):
if not ob:
return
- layout.template_column()
+ layout.split(number=2)
- layout.template_slot("COLUMN_1")
- layout.itemL(text="Time Offset:")
- layout.itemR(ob, "time_offset_edit", text="Edit")
- layout.itemR(ob, "time_offset_particle", text="Particle")
- layout.itemR(ob, "time_offset_parent", text="Parent")
- layout.itemR(ob, "slow_parent")
- layout.itemR(ob, "time_offset", text="Offset:")
+ sub = layout.sub(0)
+ sub.column()
+ sub.itemL(text="Time Offset:")
+ sub.itemR(ob, "time_offset_edit", text="Edit")
+ sub.itemR(ob, "time_offset_particle", text="Particle")
+ sub.itemR(ob, "time_offset_parent", text="Parent")
+ sub.itemR(ob, "slow_parent")
+ sub.itemR(ob, "time_offset", text="Offset:")
- layout.template_slot("COLUMN_2")
- layout.itemL(text="Tracking:")
- layout.itemR(ob, "track_axis", text="Axis")
- layout.itemR(ob, "up_axis", text="Up Axis")
- layout.itemR(ob, "track_rotation", text="Rotation")
+ sub = layout.sub(1)
+ sub.column()
+ sub.itemL(text="Tracking:")
+ sub.itemR(ob, "track_axis", text="Axis")
+ sub.itemR(ob, "up_axis", text="Up Axis")
+ sub.itemR(ob, "track_rotation", text="Rotation")
bpy.ui.addPanel(OBJECT_PT_transform, "BUTTONS_WINDOW", "WINDOW")
bpy.ui.addPanel(OBJECT_PT_groups, "BUTTONS_WINDOW", "WINDOW")
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index 4ccd8d0da48..5279aa10843 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -14,7 +14,7 @@ class RENDER_PT_shading(bpy.types.Panel):
rd = scene.render_data
- layout.template_column_flow(2)
+ layout.column_flow()
layout.itemR(rd, "render_shadows", text="Shadows")
layout.itemR(rd, "render_sss", text="SSS")
layout.itemR(rd, "render_envmaps", text="EnvMap")
@@ -22,7 +22,7 @@ class RENDER_PT_shading(bpy.types.Panel):
layout.itemR(rd, "render_raytracing", text="Ray Tracing")
layout.itemR(rd, "octree_resolution")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "alpha_mode")
class RENDER_PT_image(bpy.types.Panel):
@@ -38,13 +38,13 @@ class RENDER_PT_image(bpy.types.Panel):
rd = scene.render_data
- layout.template_column_flow(2)
+ layout.column_flow()
layout.itemR(rd, "resolution_x", text="SizeX")
layout.itemR(rd, "resolution_x", text="SizeY")
layout.itemR(rd, "pixel_aspect_x", text="AspX")
layout.itemR(rd, "pixel_aspect_y", text="AspY")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "crop_to_border")
class RENDER_PT_antialiasing(bpy.types.Panel):
@@ -60,7 +60,7 @@ class RENDER_PT_antialiasing(bpy.types.Panel):
rd = scene.render_data
- layout.template_column_flow(2)
+ layout.column_flow()
layout.itemR(rd, "antialiasing", text="Enable")
layout.itemR(rd, "antialiasing_samples", text="Samples")
layout.itemR(rd, "pixel_filter")
@@ -79,42 +79,42 @@ class RENDER_PT_render(bpy.types.Panel):
rd = scene.render_data
- layout.template_row()
+ layout.row()
layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
#layout.itemO("SCREEN_OT_render", text="ANIM", icon=0) # "anim", 1
- layout.template_row()
+ layout.row()
layout.itemR(scene, "start_frame", text="Start")
layout.itemR(scene, "end_frame", text="End")
layout.itemR(scene, "current_frame", text="Frame")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "do_composite")
layout.itemR(rd, "do_sequence")
- layout.template_row()
+ layout.row()
layout.itemL(text="General")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "resolution_percentage", text="Size ")
layout.itemR(rd, "dither_intensity")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "parts_x")
layout.itemR(rd, "parts_y")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "threads")
layout.itemR(rd, "threads_mode")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "fields", text="Fields")
layout.itemR(rd, "field_order", text="Order")
layout.itemR(rd, "fields_still", text="Still")
- layout.template_row()
+ layout.row()
layout.itemL(text="Extra:")
- layout.template_row()
+ layout.row()
layout.itemR(rd, "border", text="Border Render")
layout.itemR(rd, "panorama")