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:
authorCampbell Barton <ideasman42@gmail.com>2018-05-13 11:25:18 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-13 11:27:44 +0300
commit06a786f12d5b56fc71f4996aff767dea3fedba6e (patch)
treed7ce034522e49003b790aa7bb60882843c4c0b57 /source/blender/editors/interface/interface.c
parente7ee9cfd9e510561d87d2fd974a9f336e7eb32eb (diff)
UI: show toolbar shortcuts
When toobar text is expanded, show shortcuts (normally confined to menus).
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index ee511eff215..b63ba4166a7 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);
}