[Bf-blender-cvs] [cc8424e7332] temp-ui-layout-2.8: UI: tweak individual panels

Ines Almeida noreply at git.blender.org
Sat Oct 13 20:13:02 CEST 2018


Commit: cc8424e73324b772621045c1856f9a8869faa859
Author: Ines Almeida
Date:   Sat Oct 13 18:41:21 2018 +0200
Branches: temp-ui-layout-2.8
https://developer.blender.org/rBcc8424e73324b772621045c1856f9a8869faa859

UI: tweak individual panels

===================================================================

M	release/scripts/startup/bl_ui/properties_animviz.py
M	release/scripts/startup/bl_ui/properties_render.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/editors/interface/interface_layout.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_animviz.py b/release/scripts/startup/bl_ui/properties_animviz.py
index eb031b54caa..c031316c219 100644
--- a/release/scripts/startup/bl_ui/properties_animviz.py
+++ b/release/scripts/startup/bl_ui/properties_animviz.py
@@ -43,7 +43,8 @@ class MotionPathButtonsPanel:
 
         if mps.type == 'CURRENT_FRAME':
             col = layout.column(align=True)
-            col.prop(mps, "frame_before", text="Frame Range Before")
+            col.label(text="Frame Range")
+            col.prop(mps, "frame_before", text="Before")
             col.prop(mps, "frame_after", text="After")
             col.prop(mps, "frame_step", text="Step")
         elif mps.type == 'RANGE':
@@ -55,7 +56,8 @@ class MotionPathButtonsPanel:
                 else:
                     sub.operator("object.paths_range_update", text="", icon='TIME')
             sub = row.column(align=True)
-            sub.prop(mps, "frame_start", text="Frame Range Start")
+            sub.label(text="Frame Range")
+            sub.prop(mps, "frame_start", text="Start")
             sub.prop(mps, "frame_end", text="End")
             sub.prop(mps, "frame_step", text="Step")
 
@@ -63,9 +65,11 @@ class MotionPathButtonsPanel:
             col = layout.column(align=True)
             col.enabled = False
             if bones:
-                col.prop(mpath, "frame_start", text="Bone Cache From")
+                col.label(text="Bone Cache")
+                col.prop(mpath, "frame_start", text="From")
             else:
-                col.prop(mpath, "frame_start", text="Cache From")
+                col.label(text="Cache")
+                col.prop(mpath, "frame_start", text="From")
             col.prop(mpath, "frame_end", text="To")
 
             row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index f8262c83b14..0329f91984f 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -150,6 +150,12 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
         col.prop(rd, "resolution_y", text="Y")
         col.prop(rd, "resolution_percentage", text="%")
 
+        col = flow.column(align=True)
+        col.label(text="Frame Range")
+        col.prop(scene, "frame_start", text="Start")
+        col.prop(scene, "frame_end", text="End")
+        col.prop(scene, "frame_step", text="Step")
+
         col = flow.column(align=True)
         col.label(text="Aspect Ratio")
         col.prop(rd, "pixel_aspect_x", text="X")
@@ -161,12 +167,6 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
         sub.active = rd.use_border
         sub.prop(rd, "use_crop_to_border", text="Crop")
 
-        col = flow.column(align=True)
-        col.label(text="Frame Range")
-        col.prop(scene, "frame_start", text="Start")
-        col.prop(scene, "frame_end", text="End")
-        col.prop(scene, "frame_step", text="Step")
-
         col = flow.column(align=True)
         col.label(text="Frame Rate")
         self.draw_framerate(flow, col, rd)
@@ -256,9 +256,9 @@ class RENDER_PT_stamp(RenderButtonsPanel, Panel):
             col = flow.column()
             col.prop(rd, "use_stamp_strip_meta", text="Use Strip Metadata")
 
-        row = layout.split(factor=0.3)
-        row.prop(rd, "use_stamp_note", text="Note")
-        sub = row.row()
+        col = layout.column()
+        col.prop(rd, "use_stamp_note", text="Note")
+        sub = col.column()
         sub.active = rd.use_stamp_note
         sub.prop(rd, "stamp_note_text", text="")
 
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index dc8242c477c..780e7182320 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -156,6 +156,7 @@ class USERPREF_PT_interface(Panel):
         col.label(text="Development:")
         col.prop(view, "show_tooltips_python")
         col.prop(view, "show_developer_ui")
+        col.prop(view, "layout_row_enums")
 
         row = split.row()
         row.separator()
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index b84f3693274..86b88906d08 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3892,15 +3892,15 @@ class VIEW3D_PT_view3d_properties(Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
-        flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
-        col = flow.column()
+        col = layout.column()
 
         subcol = col.column()
         subcol.active = bool(view.region_3d.view_perspective != 'CAMERA' or view.region_quadviews)
         subcol.prop(view, "lens", text="Focal Length")
 
         subcol = col.column(align=True)
-        subcol.prop(view, "clip_start", text="Clip Start")
+        subcol.label(text="Clip")
+        subcol.prop(view, "clip_start", text="Start")
         subcol.prop(view, "clip_end", text="End")
 
         subcol.separator()
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index ccc28b6ec84..c085a294acd 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -77,8 +77,6 @@
 		return_statement;                                                     \
 	} (void)0                                                                 \
 
-#define UI_ITEM_PROP_SEP_DIVIDE 0.5f
-
 /* uiLayoutRoot */
 
 typedef struct uiLayoutRoot {
@@ -639,6 +637,7 @@ static void ui_item_enum_expand(
         uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop,
         const char *uiname, int h, bool icon_only)
 {
+	/* XXX Maybe now is the time! */
 	/* XXX The way this function currently handles uiname parameter is insane and inconsistent with general UI API:
 	 *     * uiname is the *enum property* label.
 	 *     * when it is NULL or empty, we do not draw *enum items* labels, this doubles the icon_only parameter.
@@ -1597,7 +1596,8 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
 
 		/* Decide if this item should have the label on top of the control or embedded in it. */
 		/* property with separate label */
-		label_on_top = should_display_array || type == PROP_ENUM || type == PROP_STRING || type == PROP_POINTER;
+		label_on_top = should_display_array || type == PROP_STRING || type == PROP_POINTER ||
+			(type == PROP_ENUM && ((U.flag & TEMP_USER_PROP_1LINE_ENUM) == 0) || expand);
 		if (label_on_top) {
 			/* Display a label with the property name. */
 			if (name && name[0] != '\0') {
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 6d8077633a4..47402085de1 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -702,6 +702,7 @@ typedef enum eUserPref_Flag {
 	USER_NONEGFRAMES		= (1 << 24),
 	USER_TXT_TABSTOSPACES_DISABLE	= (1 << 25),
 	USER_TOOLTIPS_PYTHON    = (1 << 26),
+	TEMP_USER_PROP_1LINE_ENUM = (1 << 27),
 } eUserPref_Flag;
 
 /* bPathCompare.flag */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 5eee0ccec37..d3da1eac7e7 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -3564,6 +3564,11 @@ static void rna_def_userdef_view(BlenderRNA *brna)
 	        prop, "Developer Extras",
 	        "Show options for developers (edit source in context menu, geometry indices)");
 
+	prop = RNA_def_property(srna, "layout_row_enums", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", TEMP_USER_PROP_1LINE_ENUM);
+	RNA_def_property_ui_text(prop, "UI Layout: 1 line enums",
+		"Show enums with the label and the options list in a row instead of a column");
+
 	prop = RNA_def_property(srna, "show_object_info", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO);
 	RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3D view");



More information about the Bf-blender-cvs mailing list