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-10-03 01:00:41 +0300
committerHans Goudey <h.goudey@me.com>2020-10-03 01:00:56 +0300
commit3eab2248c346081b76c8379656aeff2a473a3da4 (patch)
treebfcc3cb07bf66a6a4ad3916baabea18157480048 /source/blender/editors/interface/interface_intern.h
parent28a2c84948cc2296dd86c5ddfc208035328a7b67 (diff)
UI: Move button groups from layout to block level
For a future patch (D9006) we need these groups for longer than just the the layout process, in order to differentiate buttons in panel headers. It may also be helpful in the future to have a way to access related buttons added in the same uiLayout.prop call. With this commit, the groups are stored in and destructed with the uiBlock.
Diffstat (limited to 'source/blender/editors/interface/interface_intern.h')
-rw-r--r--source/blender/editors/interface/interface_intern.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 194726b1347..5a5e962e2bc 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -417,6 +417,17 @@ enum eBlockContentHints {
UI_BLOCK_CONTAINS_SUBMENU_BUT = (1 << 0),
};
+/**
+ * A group of button references, used by property search to keep track of sets of buttons that
+ * should be searched together. For example, in property split layouts number buttons and their
+ * labels (and even their decorators) are separate buttons, but they must be searched and
+ * highlighted together.
+ */
+typedef struct uiButtonGroup {
+ void *next, *prev;
+ ListBase buttons; /* #LinkData with #uiBut data field. */
+} uiButtonGroup;
+
struct uiBlock {
uiBlock *next, *prev;
@@ -426,6 +437,8 @@ struct uiBlock {
ListBase butstore; /* UI_butstore_* runtime function */
+ ListBase button_groups; /* #uiButtonGroup. */
+
ListBase layouts;
struct uiLayout *curlayout;
@@ -999,7 +1012,6 @@ void ui_resources_free(void);
/* interface_layout.c */
void ui_layout_add_but(uiLayout *layout, uiBut *but);
bool ui_layout_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but);
-void ui_button_group_replace_but_ptr(uiLayout *layout, const void *old_but_ptr, uiBut *new_but);
uiBut *ui_but_add_search(uiBut *but,
PointerRNA *ptr,
PropertyRNA *prop,
@@ -1010,6 +1022,12 @@ void ui_layout_list_set_labels_active(uiLayout *layout);
void ui_item_menutype_func(struct bContext *C, struct uiLayout *layout, void *arg_mt);
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_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);
+
/* interface_align.c */
bool ui_but_can_align(const uiBut *but) ATTR_WARN_UNUSED_RESULT;
int ui_but_align_opposite_to_area_align_get(const struct ARegion *region) ATTR_WARN_UNUSED_RESULT;