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:11:44 +0300
committerHans Goudey <h.goudey@me.com>2020-10-03 01:11:44 +0300
commit743eca0f316d1ec2ef16e6066d7cfc5233c92657 (patch)
treecbb6cd22942c9be663642e7278a4f1485d04c87d /source/blender/editors/interface
parent3eab2248c346081b76c8379656aeff2a473a3da4 (diff)
UI: Create button group if none exists
This makes it unecessary to create a button group when the block is created, giving more flexibility when creating the first group-- for example, creating the first button group with special parameters.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c1
-rw-r--r--source/blender/editors/interface/interface_button_group.c5
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index d06e3fd718d..98e76114956 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -3476,7 +3476,6 @@ uiBlock *UI_block_begin(const bContext *C, ARegion *region, const char *name, ch
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
diff --git a/source/blender/editors/interface/interface_button_group.c b/source/blender/editors/interface/interface_button_group.c
index e890d0136cb..455a3c6a69c 100644
--- a/source/blender/editors/interface/interface_button_group.c
+++ b/source/blender/editors/interface/interface_button_group.c
@@ -41,10 +41,11 @@ void ui_block_new_button_group(uiBlock *block)
void ui_button_group_add_but(uiBlock *block, uiBut *but)
{
- BLI_assert(block != NULL);
+ if (BLI_listbase_is_empty(&block->button_groups)) {
+ ui_block_new_button_group(block);
+ }
uiButtonGroup *current_button_group = block->button_groups.last;
- BLI_assert(current_button_group != NULL);
/* We can't use the button directly because adding it to
* this list would mess with its prev and next pointers. */