[Bf-blender-cvs] [820350ac80b] temp-checkbox-layout-tweaks: Fix layout when using uiItemFullR() after uiItemL_respect_property_split()

Julian Eisel noreply at git.blender.org
Thu Apr 9 02:41:24 CEST 2020


Commit: 820350ac80b1a86f5e67fdb90f6396dbebfe16e4
Author: Julian Eisel
Date:   Thu Apr 9 02:34:33 2020 +0200
Branches: temp-checkbox-layout-tweaks
https://developer.blender.org/rB820350ac80b1a86f5e67fdb90f6396dbebfe16e4

Fix layout when using uiItemFullR() after uiItemL_respect_property_split()

Also make the decorator layout as return value easier to understand.

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

M	source/blender/editors/interface/interface_layout.c

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 652cd518e4b..9c148d262cb 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -3067,6 +3067,10 @@ uiLayout *uiItemL_respect_property_split(uiLayout *layout, const char *text, int
 {
   if (layout->item.flag & UI_ITEM_PROP_SEP) {
     uiBlock *block = uiLayoutGetBlock(layout);
+
+    /* Don't do further splits of the layout. */
+    uiLayoutSetPropSep(layout, false);
+
     uiLayout *layout_row = uiLayoutRow(layout, true);
     uiLayout *layout_split = uiLayoutSplit(layout_row, UI_ITEM_PROP_SEP_DIVIDE, true);
     uiLayout *layout_sub = uiLayoutColumn(layout_split, true);
@@ -3079,8 +3083,9 @@ uiLayout *uiItemL_respect_property_split(uiLayout *layout, const char *text, int
     layout_split = ui_item_prop_split_layout_hack(layout, layout_split);
     UI_block_layout_set_current(block, layout_split);
 
-    /* Give caller a new sub-row to place items in. */
-    return layout_row;
+    /* The decorator layout uses the row the split layout was inserted to.  */
+    uiLayout *layout_decorator = layout_row;
+    return layout_decorator;
   }
   else {
     char namestr[UI_MAX_NAME_STR];



More information about the Bf-blender-cvs mailing list