diff options
author | Hans Goudey <h.goudey@me.com> | 2020-09-29 17:33:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-09-29 17:33:48 +0300 |
commit | ece8f69f856dc27b5ac1b10796ca9609457df5ec (patch) | |
tree | 757e83fda6ed949e137281c3988833f70d08a80a /source/blender/editors/interface/interface_panel.c | |
parent | bab2260b59c7bffe1e16b5e860ac36b5fdc31bf0 (diff) |
Property Search: Set expansion properly for child panels
Although I haven't seen this cause any visible errors, there is some
incorrect handling for setting panel expansion during search:
- Properly check if child panel is active first
- Don't stop traversal at headerless panels that could theoretically
have children
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r-- | source/blender/editors/interface/interface_panel.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 65415a750bb..a23929ad789 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -846,18 +846,18 @@ bool UI_panel_matches_search_filter(const Panel *panel) */ static void panel_set_expansion_from_seach_filter_recursive(const bContext *C, Panel *panel) { - short start_flag = panel->flag; - SET_FLAG_FROM_TEST(panel->flag, !UI_panel_matches_search_filter(panel), PNL_CLOSED); - if (start_flag != panel->flag) { - panel_activate_state(C, panel, PANEL_STATE_ANIMATION); + if (!(panel->type->flag & PNL_NO_HEADER)) { + short start_flag = panel->flag; + SET_FLAG_FROM_TEST(panel->flag, !UI_panel_matches_search_filter(panel), PNL_CLOSED); + if (start_flag != panel->flag) { + panel_activate_state(C, panel, PANEL_STATE_ANIMATION); + } } /* If the panel is filtered (removed) we need to check that its children are too. */ LISTBASE_FOREACH (Panel *, child_panel, &panel->children) { - if (panel->runtime_flag & PANEL_ACTIVE) { - if (!(panel->type->flag & PNL_NO_HEADER)) { - panel_set_expansion_from_seach_filter_recursive(C, child_panel); - } + if (child_panel->runtime_flag & PANEL_ACTIVE) { + panel_set_expansion_from_seach_filter_recursive(C, child_panel); } } } @@ -870,9 +870,7 @@ void UI_panels_set_expansion_from_seach_filter(const bContext *C, ARegion *regio { LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { if (panel->runtime_flag & PANEL_ACTIVE) { - if (!(panel->type->flag & PNL_NO_HEADER)) { - panel_set_expansion_from_seach_filter_recursive(C, panel); - } + panel_set_expansion_from_seach_filter_recursive(C, panel); } } } |