Commit: f2c8935295d29caae9d7e24db6003d7eaac5b89c
Author: Hans Goudey
Date:   Tue Aug 11 22:14:01 2020 -0400
Branches: property-search-ui-v2
https://developer.blender.org/rBf2c8935295d29caae9d7e24db6003d7eaac5b89c

Merge branch 'master' into property-search-ui-v2

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



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

diff --cc source/blender/editors/interface/interface_layout.c
index b885ac76851,888cacb64eb..40f6fe24650
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@@ -983,24 -937,28 +983,30 @@@ static uiBut *ui_item_with_label(uiLayo
                                   int h,
                                   int flag)
  {
-   uiLayout *sub;
+   uiLayout *sub = layout;
    uiBut *but = NULL;
 +  uiBut *label_but = NULL;
    PropertyType type;
    PropertySubType subtype;
    int prop_but_width = w_hint;
  #ifdef UI_PROP_DECORATE
 +  uiBut *decorator_but = NULL;
    uiLayout *layout_prop_decorate = NULL;
    const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0);
+   const bool use_prop_decorate = use_prop_sep && (layout->item.flag & 
UI_ITEM_PROP_DECORATE) &&
+                                  (layout->item.flag & 
UI_ITEM_PROP_DECORATE_NO_PAD) == 0;
  #endif
  
-   /* Previously 'align' was enabled to make sure the label is spaced closely 
to the button.
-    * Set the space to zero instead as aligning a large number of labels can 
end up aligning
-    * thousands of buttons when displaying key-map search (a heavy operation), 
see: T78636. */
-   sub = uiLayoutRow(layout, false);
-   sub->space = 0;
-   UI_block_layout_set_current(block, sub);
+   UI_block_layout_set_current(block, layout);
+ 
+   /* Only add new row if more than 1 item will be added. */
+   if (name[0] || use_prop_decorate) {
+     /* Also avoid setting 'align' if possible. Set the space to zero instead 
as aligning a large
+      * number of labels can end up aligning thousands of buttons when 
displaying key-map search (a
+      * heavy operation), see: T78636. */
+     sub = uiLayoutRow(layout, layout->align);
+     sub->space = 0;
+   }
  
  #ifdef UI_PROP_DECORATE
    if (name[0]) {
@@@ -1099,12 -1056,8 +1105,8 @@@
  
  #ifdef UI_PROP_DECORATE
    /* Only for alignment. */
-   if (use_prop_sep) { /* Flag may have been unset meanwhile. */
-     if ((layout->item.flag & UI_ITEM_PROP_DECORATE) &&
-         (layout->item.flag & UI_ITEM_PROP_DECORATE_NO_PAD) == 0) {
-       decorator_but = uiItemL_(
-           layout_prop_decorate ? layout_prop_decorate : sub, NULL, 
ICON_BLANK1);
-     }
+   if (use_prop_decorate) { /* Note that sep flag may have been unset 
meanwhile. */
 -    uiItemL(layout_prop_decorate ? layout_prop_decorate : sub, NULL, 
ICON_BLANK1);
++    decorator_but = uiItemL_(layout_prop_decorate ? layout_prop_decorate : 
sub, NULL, ICON_BLANK1);
    }
  #endif /* UI_PROP_DECORATE */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to