[Bf-blender-cvs] [a53a0f52783] temp-ui-layout-2.8: UI: Changes to the 'single-column' layout to have left-aligned labels on top of the values

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


Commit: a53a0f5278386569705b287ea014df3eac92ebc0
Author: Ines Almeida
Date:   Sat Oct 13 13:44:36 2018 +0200
Branches: temp-ui-layout-2.8
https://developer.blender.org/rBa53a0f5278386569705b287ea014df3eac92ebc0

UI: Changes to the 'single-column' layout to have left-aligned labels on top of the values

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

M	release/scripts/addons
M	release/scripts/startup/bl_ui/properties_object.py
M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_view3d/view3d_buttons.c
M	source/blender/makesrna/intern/rna_ui.c
M	source/blender/makesrna/intern/rna_ui_api.c

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

diff --git a/release/scripts/addons b/release/scripts/addons
index 2d1a067b12a..e4063432880 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 2d1a067b12aa1c43e7935c09e424808ec78dccb2
+Subproject commit e406343288065a73a01610a5b732dae373555d2f
diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py
index 2dfbf2aa153..a0c5b8ea5ba 100644
--- a/release/scripts/startup/bl_ui/properties_object.py
+++ b/release/scripts/startup/bl_ui/properties_object.py
@@ -54,48 +54,51 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
 
         ob = context.object
 
+        # Location.
         col = flow.column()
         row = col.row(align=True)
         row.prop(ob, "location")
-        row.use_property_decorate = False
-        row.prop(ob, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED')
+        sub = row.column(align=True)
+        sub.use_property_decorate = False
+        sub.label(text="") # Empty row for alignment (matches the property name).
+        sub.prop(ob, "lock_location", text="", emboss=False, icon='DECORATE_UNLOCKED')
 
+        # Rotation.
+        col = flow.column()
+        row = col.row(align=True)
+        left = row.column(align=True)
         if ob.rotation_mode == 'QUATERNION':
-            col = flow.column()
-            row = col.row(align=True)
-            row.prop(ob, "rotation_quaternion", text="Rotation")
-            sub = row.column(align=True)
-            sub.use_property_decorate = False
-            sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
-            sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            left.prop(ob, "rotation_quaternion", text="Rotation")
+            right = row.column(align=True)
+            right.use_property_decorate = False
+            right.label(text="") # Empty row for alignment (matches the property name).
+            right.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            right.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
         elif ob.rotation_mode == 'AXIS_ANGLE':
-            # row.column().label(text="Rotation")
-            #row.column().prop(pchan, "rotation_angle", text="Angle")
-            #row.column().prop(pchan, "rotation_axis", text="Axis")
-            col = flow.column()
-            row = col.row(align=True)
-            row.prop(ob, "rotation_axis_angle", text="Rotation")
-
-            sub = row.column(align=True)
-            sub.use_property_decorate = False
-            sub.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
-            sub.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            left.prop(ob, "rotation_axis_angle", text="Rotation")
+            right = row.column(align=True)
+            right.use_property_decorate = False
+            right.label(text="") # Empty row for alignment (matches the property name).
+            right.prop(ob, "lock_rotation_w", text="", emboss=False, icon='DECORATE_UNLOCKED')
+            right.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
         else:
-            col = flow.column()
-            row = col.row(align=True)
-            row.prop(ob, "rotation_euler", text="Rotation")
-            row.use_property_decorate = False
-            row.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
-
+            left.prop(ob, "rotation_euler", text="Rotation")
+            right = row.column(align=True)
+            right.use_property_decorate = False
+            right.label(text="") # Empty row for alignment (matches the property name).
+            right.prop(ob, "lock_rotation", text="", emboss=False, icon='DECORATE_UNLOCKED')
+        # Rotation Mode.
+        row = left.row(align=True)
+        row.prop(ob, "rotation_mode", text="")
+
+        # Scale.
         col = flow.column()
         row = col.row(align=True)
         row.prop(ob, "scale")
-        row.use_property_decorate = False
-        row.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')
-
-        row = layout.row(align=True)
-        row.prop(ob, "rotation_mode")
-        row.label(text="", icon='BLANK1')
+        sub = row.column(align=True)
+        sub.use_property_decorate = False
+        sub.label(text="") # Empty row for alignment (matches the property name).
+        sub.prop(ob, "lock_scale", text="", emboss=False, icon='DECORATE_UNLOCKED')
 
 
 class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index ec5ddf5cd65..f8262c83b14 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -142,30 +142,34 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
         scene = context.scene
         rd = scene.render
 
-        col = layout.column(align=True)
-        col.prop(rd, "resolution_x", text="Resolution X")
+        flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
+        col = flow.column(align=True)
+        col.label(text="Resolution")
+        col.prop(rd, "resolution_x", text="X")
         col.prop(rd, "resolution_y", text="Y")
         col.prop(rd, "resolution_percentage", text="%")
 
-        col = layout.column(align=True)
-        col.prop(rd, "pixel_aspect_x", text="Aspect X")
+        col = flow.column(align=True)
+        col.label(text="Aspect Ratio")
+        col.prop(rd, "pixel_aspect_x", text="X")
         col.prop(rd, "pixel_aspect_y", text="Y")
 
-        col = layout.column(align=True)
+        col = flow.column(align=True)
         col.prop(rd, "use_border", text="Border")
         sub = col.column(align=True)
         sub.active = rd.use_border
         sub.prop(rd, "use_crop_to_border", text="Crop")
 
-        col = layout.column(align=True)
-        col.prop(scene, "frame_start", text="Frame Start")
+        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 = layout.split()
-        col.alignment = 'RIGHT'
+        col = flow.column(align=True)
         col.label(text="Frame Rate")
-        self.draw_framerate(layout, col, rd)
+        self.draw_framerate(flow, col, rd)
 
 
 class RENDER_PT_frame_remapping(RenderButtonsPanel, Panel):
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 13d1c2b8916..72766087930 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -993,8 +993,10 @@ void uiLayoutSetScaleX(uiLayout *layout, float scale);
 void uiLayoutSetScaleY(uiLayout *layout, float scale);
 void uiLayoutSetUnitsX(uiLayout *layout, float unit);
 void uiLayoutSetUnitsY(uiLayout *layout, float unit);
+void uiLayoutSetSpacing(uiLayout *layout, short spacing);
 void uiLayoutSetEmboss(uiLayout *layout, char emboss);
-void uiLayoutSetPropSep(uiLayout *layout, bool is_sep);
+void uiLayoutSetGroupItems(uiLayout *layout, bool group_items);
+void uiLayoutSetPropSingleCol(uiLayout *layout, bool is_sep);
 void uiLayoutSetPropDecorate(uiLayout *layout, bool is_sep);
 
 int uiLayoutGetOperatorContext(uiLayout *layout);
@@ -1008,8 +1010,10 @@ float uiLayoutGetScaleX(uiLayout *layout);
 float uiLayoutGetScaleY(uiLayout *layout);
 float uiLayoutGetUnitsX(uiLayout *layout);
 float uiLayoutGetUnitsY(uiLayout *layout);
+short uiLayoutGetSpacing(uiLayout *layout);
 int uiLayoutGetEmboss(uiLayout *layout);
-bool uiLayoutGetPropSep(uiLayout *layout);
+bool uiLayoutGetGroupItems(uiLayout *layout);
+bool uiLayoutGetPropSingleCol(uiLayout *layout);
 bool uiLayoutGetPropDecorate(uiLayout *layout);
 
 /* layout specifiers */
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8612a14c308..ccc28b6ec84 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -67,9 +67,6 @@
 /* Show an icon button after each RNA button to use to quickly set keyframes,
  * this is a way to display animation/driven/override status, see T54951. */
 #define UI_PROP_DECORATE
-/* Alternate draw mode where some buttons can use single icon width,
- * giving more room for the text at the expense of nicely aligned text. */
-#define UI_PROP_SEP_ICON_WIDTH_EXCEPTION
 
 /************************ Structs and Defines *************************/
 
@@ -139,11 +136,12 @@ enum {
 	UI_ITEM_MIN       = 1 << 1,
 
 	UI_ITEM_BOX_ITEM  = 1 << 2, /* The item is "inside" a box item */
-	UI_ITEM_PROP_SEP  = 1 << 3,
+
+	/* If an item is included in a layout adhering to the new Blender 2.8 single column layout. */
+	UI_ITEM_PROP_SINGLE_COL = 1 << 3,
 	/* Show an icon button next to each property (to set keyframes, show status).
-	 * Enabled by default, depends on 'UI_ITEM_PROP_SEP'. */
+	 * Enabled by default, depends on 'UI_ITEM_PROP_SINGLE_COL'. */
 	UI_ITEM_PROP_DECORATE = 1 << 4,
-	UI_ITEM_PROP_DECORATE_NO_PAD  = 1 << 5,
 };
 
 typedef struct uiButtonItem {
@@ -436,7 +434,8 @@ static void ui_layer_but_cb(bContext *C, void *arg_but, void *arg_index)
 static void ui_item_array(
         uiLayout *layout, uiBlock *block, const char *name, int icon,
         PointerRNA *ptr, PropertyRNA *prop, int len, int x, int y, int w, int UNUSED(h),
-        bool expand, bool slider, bool toggle, bool icon_only, bool compact, bool show_text)
+        bool expand, bool slider, bool toggle, bool icon_only, bool compact,
+		bool show_embedded_text, bool show_prop_name)
 {
 	uiStyle *style = layout->root->style;
 	uiBut *but;
@@ -453,7 +452,7 @@ static void ui_item_array(
 	UI_block_layout_set_current(block, sub);
 
 	/* create label */
-	if (name[0] && show_text) {
+	if (name && name[0] && show_prop_name) {
 		uiDefBu

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list