[Bf-blender-cvs] [3178dc25f6e] master: Fix T81470: Buttons in closed panel visible during search

Hans Goudey noreply at git.blender.org
Mon Oct 5 23:23:33 CEST 2020


Commit: 3178dc25f6edc95d6de49ab2894303aedc0a23b3
Author: Hans Goudey
Date:   Mon Oct 5 16:23:21 2020 -0500
Branches: master
https://developer.blender.org/rB3178dc25f6edc95d6de49ab2894303aedc0a23b3

Fix T81470: Buttons in closed panel visible during search

The buttons hide when the search finishes based on whether they are in
the "panel header" group. These buttons were not protected with a new
group. This adds a new group for operator button calls, and also makes
it so a new group is always created after the header buttons.

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

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

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index d0621051023..b13dd24ea4b 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1163,8 +1163,8 @@ static uiBut *uiItemFullO_ptr_ex(uiLayout *layout,
     icon = ICON_BLANK1;
   }
 
-  /* create button */
   UI_block_layout_set_current(block, layout);
+  ui_block_new_button_group(block, 0);
 
   const int w = ui_text_icon_width(layout, name, icon, 0);
 
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index f50975760f1..a68cfd53a26 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -770,6 +770,8 @@ void UI_panel_header_buttons_end(Panel *panel)
 
   uiButtonGroup *button_group = block->button_groups.last;
 
+  button_group->flag &= ~UI_BUTTON_GROUP_LOCK;
+
   /* Repurpose the first "header" button group if it is empty, in case the first button added to
    * the panel doesn't add a new group (if the button is created directly rather than through an
    * interface layout call). */
@@ -777,8 +779,12 @@ void UI_panel_header_buttons_end(Panel *panel)
       BLI_listbase_is_empty(&button_group->buttons)) {
     button_group->flag &= ~UI_BUTTON_GROUP_PANEL_HEADER;
   }
-
-  button_group->flag &= ~UI_BUTTON_GROUP_LOCK;
+  else {
+    /* We should still always add a new button group. Although this results in many empty groups,
+     * without it, new buttons not protected with a #ui_block_new_button_group call would end up
+     * in the panel header group. */
+    ui_block_new_button_group(block, 0);
+  }
 }
 
 static float panel_region_offset_x_get(const ARegion *region)



More information about the Bf-blender-cvs mailing list