diff options
author | Hans Goudey <h.goudey@me.com> | 2020-10-03 19:25:13 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-03 19:25:13 +0300 |
commit | cb6234fccf7dfd3e09555cac18357427d802be1d (patch) | |
tree | 7d7b97232f84b0cce218e7b8635032ed67875eb5 /source/blender/editors/interface/interface_intern.h | |
parent | 724370b2f9727c007b911c036183b844dbc2ab59 (diff) |
Property Search: Set panel expansion when tab changes
This commit makes the panel expansion set based on the search results
when the active tab in the properties editor changes. The multi-tab
search patch (D8859) actually doesn't handle this because it uses a
different code path.
This feature uncovered a subtle but fairly significant issue with the
implementation of property search (More details in T81113). Basically,
the search needed multiple redraws to properly display the expansion of
panels based on the search results. Because there is no animation of
panel expansion when switching tabs, the problem was exposed only now.
With this commit, hiding of "search only" buttons and panel size
calculation happens in a single final step of the panel layout pass.
The "search only" layout root flag is removed. Instead every button
inside a panel header is in a single "uiButtonGroup" marked with a
specific "in header" flag, an idea which could be generalized in the
future.
Differential Revision: https://developer.blender.org/D9006
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 5a5e962e2bc..dc1f6cfce50 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -426,8 +426,17 @@ enum eBlockContentHints { typedef struct uiButtonGroup { void *next, *prev; ListBase buttons; /* #LinkData with #uiBut data field. */ + short flag; } uiButtonGroup; +/* #uiButtonGroup.flag. */ +typedef enum uiButtonGroupFlag { + /** While this flag is set, don't create new button groups for layout item calls. */ + UI_BUTTON_GROUP_LOCK = (1 << 0), + /** The buttons in this group are inside a panel header. */ + UI_BUTTON_GROUP_PANEL_HEADER = (1 << 1), +} uiButtonGroupFlag; + struct uiBlock { uiBlock *next, *prev; @@ -1023,7 +1032,7 @@ void ui_item_menutype_func(struct bContext *C, struct uiLayout *layout, void *ar void ui_item_paneltype_func(struct bContext *C, struct uiLayout *layout, void *arg_pt); /* interface_button_group.c */ -void ui_block_new_button_group(uiBlock *block); +void ui_block_new_button_group(uiBlock *block, short flag); void ui_button_group_add_but(uiBlock *block, uiBut *but); void ui_button_group_replace_but_ptr(uiBlock *block, const void *old_but_ptr, uiBut *new_but); void ui_block_free_button_groups(uiBlock *block); |