Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2020-09-24 00:24:20 +0300
committerHans Goudey <h.goudey@me.com>2020-09-24 00:24:20 +0300
commit15afaa3db25a2416889abf39b800bca6d16f27d1 (patch)
tree5052e510d97a4a4fa0a562c22fdf710a502a19df /source/blender/editors/interface/interface_panel.c
parent23e4bbefae26838b7e677ae1676f2f0fe7a30d26 (diff)
Property Search: Fix matches in headers not used for expansion
Setting the search match flag every time property search runs can invalidate the results for panel headers. Instead, clear the flag on every redraw and or the result of every search in the panel to it.
Diffstat (limited to 'source/blender/editors/interface/interface_panel.c')
-rw-r--r--source/blender/editors/interface/interface_panel.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 7bbc2c7e4a7..18b134ced4a 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -813,9 +813,9 @@ static void ui_offset_panel_block(uiBlock *block)
block->rect.xmin = block->rect.ymin = 0.0;
}
-void ui_panel_set_search_filter_match(struct Panel *panel, const bool value)
+void ui_panel_tag_search_filter_match(struct Panel *panel)
{
- SET_FLAG_FROM_TEST(panel->runtime_flag, value, PANEL_SEARCH_FILTER_MATCH);
+ panel->runtime_flag |= PANEL_SEARCH_FILTER_MATCH;
}
static void panel_matches_search_filter_recursive(const Panel *panel, bool *filter_matches)
@@ -1884,24 +1884,27 @@ static void ui_do_animate(bContext *C, Panel *panel)
}
}
-static void panel_list_clear_active(ListBase *lb)
+static void panels_layout_begin_clear_flags(ListBase *lb)
{
LISTBASE_FOREACH (Panel *, panel, lb) {
- if (panel->runtime_flag & PANEL_ACTIVE) {
- panel->runtime_flag = PANEL_WAS_ACTIVE;
- }
- else {
- panel->runtime_flag = 0;
+ /* Flags to copy over to the next layout pass. */
+ const short flag_copy = 0;
+
+ const bool was_active = panel->runtime_flag & PANEL_ACTIVE;
+ panel->runtime_flag &= flag_copy;
+ if (was_active) {
+ panel->runtime_flag |= PANEL_WAS_ACTIVE;
}
- panel_list_clear_active(&panel->children);
+ panels_layout_begin_clear_flags(&panel->children);
}
}
void UI_panels_begin(const bContext *UNUSED(C), ARegion *region)
{
- /* Set all panels as inactive, so that at the end we know which ones were used. */
- panel_list_clear_active(&region->panels);
+ /* Set all panels as inactive, so that at the end we know which ones were used. Also
+ * clear other flags so we know later that their values were set for th current redraw. */
+ panels_layout_begin_clear_flags(&region->panels);
}
void UI_panels_end(const bContext *C, ARegion *region, int *r_x, int *r_y)