diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-05-13 15:57:06 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-05-13 15:57:06 +0300 |
commit | b088a387915950c9419d5326e7269bea3869d140 (patch) | |
tree | 4401b70a3398316e45303a7ad0085f6bfd1f59ed /source/blender/editors/interface/interface.c | |
parent | 0bbc97b63ae9e71890089ff0c3da02eb8ddfdea3 (diff) | |
parent | 3d376dfd52d9ca7b3b76fb2f9f1819d0e93a8856 (diff) |
Merge branch 'topbar' into temp-tab_drag_drop
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 27f2c08ee41..b8e80f40b58 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1096,7 +1096,7 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block) uiBut *but; char buf[128]; - BLI_assert(block->flag & UI_BLOCK_LOOP); + BLI_assert(block->flag & (UI_BLOCK_LOOP | UI_BLOCK_SHOW_SHORTCUT_ALWAYS)); /* only do it before bounding */ if (block->rect.xmin != block->rect.xmax) @@ -1112,7 +1112,13 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block) } else { for (but = block->buttons.first; but; but = but->next) { - if (but->dt != UI_EMBOSS_PULLDOWN) { + if (block->flag & UI_BLOCK_SHOW_SHORTCUT_ALWAYS) { + /* Skip icon-only buttons (as used in the toolbar). */ + if (but->drawstr[0] == '\0') { + continue; + } + } + else if (but->dt != UI_EMBOSS_PULLDOWN) { continue; } @@ -1216,7 +1222,7 @@ void UI_block_end_ex(const bContext *C, uiBlock *block, const int xy[2], int r_x ui_menu_block_set_keyaccels(block); /* could use a different flag to check */ } - if (block->flag & UI_BLOCK_LOOP) { + if (block->flag & (UI_BLOCK_LOOP | UI_BLOCK_SHOW_SHORTCUT_ALWAYS)) { ui_menu_block_set_keymaps(C, block); } |