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>2019-10-27 18:51:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-27 18:57:56 +0300
commitae55523013642f2897e840f30ad62c74d31df3e0 (patch)
treec8f3af1b967ef05b1aee8a6c90a828c1dbc499b1 /source/blender/windowmanager
parentc036db9f57ff1bf5762e2b4dda802ee41cdbd115 (diff)
UI: add utility to show icons for the keymap item
This is useful for drawing keymap items into the header or status bar While these icons are available directly, mapping them from the keymap item isn't trivial.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 97fad9fcf59..1dd37dd2843 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -5318,17 +5318,7 @@ bool WM_window_modal_keymap_status_draw(bContext *UNUSED(C), wmWindow *win, uiLa
/* Assume release events just disable something which was toggled on. */
continue;
}
- int icon_mod[4];
-#ifdef WITH_HEADLESS
- int icon = 0;
-#else
- int icon = UI_icon_from_keymap_item(kmi, icon_mod);
-#endif
- if (icon != 0) {
- for (int j = 0; j < ARRAY_SIZE(icon_mod) && icon_mod[j]; j++) {
- uiItemL(row, "", icon_mod[j]);
- }
- uiItemL(row, items[i].name, icon);
+ if (uiTemplateEventFromKeymapItem(row, items[i].name, kmi, false)) {
show_text = false;
}
}