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:
authorJulian Eisel <eiseljulian@gmail.com>2017-07-27 12:49:41 +0300
committerJulian Eisel <eiseljulian@gmail.com>2017-07-27 13:28:16 +0300
commit980efaf4fde6746407e849e1e5e1f9f0c0b33322 (patch)
tree3e70ec169bff4b50a71accba88a34047baae7bce /source/blender/editors/interface/interface.c
parent492b5d0bc3345be1b14bc25fd68f62e8d8af8c79 (diff)
Fix button text overlapping with shortcut text in popups
The purpose of the keymap strings is probably for un-embossed menu items like seen in most pulldowns. I can't see a reason for also adding that string for regularly drawn buttons within popups, we don't add it anywhere else in the UI either. So this commit makes sure shortcut strings are only added to buttons that are drawn like pulldown-menu items.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r--source/blender/editors/interface/interface.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index da1bfd397b8..3acee07c087 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -1166,6 +1166,8 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
uiBut *but;
char buf[128];
+ BLI_assert(block->flag & UI_BLOCK_LOOP);
+
/* only do it before bounding */
if (block->rect.xmin != block->rect.xmax)
return;
@@ -1180,6 +1182,9 @@ 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) {
+ continue;
+ }
if (ui_but_event_operator_string(C, but, buf, sizeof(buf))) {
ui_but_add_shortcut(but, buf, false);