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.c
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.c')
-rw-r--r--source/blender/editors/interface/interface.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 85097a80b53..d06e3fd718d 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3392,6 +3392,8 @@ void UI_block_free(const bContext *C, uiBlock *block)
BLI_freelistN(&block->saferct);
BLI_freelistN(&block->color_pickers.list);
+ ui_block_free_button_groups(block);
+
MEM_freeN(block);
}
@@ -3473,6 +3475,9 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, ch
block->emboss = emboss;
block->evil_C = (void *)C; /* XXX */
+ BLI_listbase_clear(&block->button_groups);
+ ui_block_new_button_group(block);
+
if (scene) {
/* store display device name, don't lookup for transformations yet
* block could be used for non-color displays where looking up for transformation
@@ -3944,7 +3949,7 @@ uiBut *ui_but_change_type(uiBut *but, eButType new_type)
const bool found_layout = ui_layout_replace_but_ptr(but->layout, old_but_ptr, but);
BLI_assert(found_layout);
UNUSED_VARS_NDEBUG(found_layout);
- ui_button_group_replace_but_ptr(but->layout, old_but_ptr, but);
+ ui_button_group_replace_but_ptr(uiLayoutGetBlock(but->layout), old_but_ptr, but);
}
}