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:
authorVuk Gardašević <lijenstina>2018-07-17 13:17:42 +0300
committerPablo Vazquez <venomgfx@gmail.com>2018-07-17 13:17:42 +0300
commit84d4037363b325a279ef87b6b1c430be29984357 (patch)
treebf855b6c0f0bf0d66e0fc3e6c9a0d27641c2e10a /release/scripts/modules/rna_prop_ui.py
parent273482749ef7e937de8a1a2c886576a9418c7f0e (diff)
UI: Single-column and flow layout for Scene properties
See D3532
Diffstat (limited to 'release/scripts/modules/rna_prop_ui.py')
-rw-r--r--release/scripts/modules/rna_prop_ui.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index bdb0751c973..8453077be85 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -132,6 +132,11 @@ def draw(layout, context, context_member, property_type, use_edit=True):
show_developer_ui = context.user_preferences.view.show_developer_ui
rna_properties = {prop.identifier for prop in rna_item.bl_rna.properties if prop.is_runtime} if items else None
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
+
for key, val in items:
if key == '_RNA_UI':
@@ -143,7 +148,6 @@ def draw(layout, context, context_member, property_type, use_edit=True):
if is_rna and not show_developer_ui:
continue
- row = layout.row()
to_dict = getattr(val, "to_dict", None)
to_list = getattr(val, "to_list", None)
@@ -157,17 +161,20 @@ def draw(layout, context, context_member, property_type, use_edit=True):
else:
val_draw = val
+ row = flow.row(align=True)
box = row.box()
if use_edit:
split = box.split(percentage=0.75)
- row = split.row()
+ row = split.row(align=True)
else:
- row = box.row()
+ row = box.row(align=True)
+
+ row.alignment = "RIGHT"
row.label(text=key, translate=False)
- # explicit exception for arrays
+ # explicit exception for arrays.
if to_dict or to_list:
row.label(text=val_draw, translate=False)
else:
@@ -186,6 +193,8 @@ def draw(layout, context, context_member, property_type, use_edit=True):
else:
row.label(text="API Defined")
+ del flow
+
class PropertyPanel:
"""