diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 13:18:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-26 13:18:54 +0300 |
commit | cdd915e9e9646b9dcb83999712f48546fb830c1f (patch) | |
tree | 8b84563f7f4f59248c2c0151289bd53a9b919921 /source/blender/editors/interface | |
parent | 4adf19e80b5f7bed2737d720ba99d8d6d60ca955 (diff) |
UI: status bar cursor keymap display
Show mouse button actions in status bar, based on context,
modifiers and active tool.
See: T54861
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 61cb0cda8c8..c2bea466015 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -4295,6 +4295,24 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C) NULL, 0.0f, 0.0f, 0, 0, ""); } + +void uiTemplateCursorKeymap(uiLayout *layout, struct bContext *C) +{ + wmWindow *win = CTX_wm_window(C); + for (int i = 0; i < 3; i++) { + uiLayout *box = uiLayoutRow(layout, true); + for (int j = 0; j < 2; j++) { + const char *msg = WM_window_cursor_keymap_status_get(win, i, j); + if ((j == 0) || (msg != NULL)) { + uiItemL(box, msg, j == 0 ? (ICON_MOUSE_LMB + i) : ICON_MOUSE_DRAG); + } + } + if (i != 2) { + uiItemSpacer(layout); + } + } +} + /********************************* Keymap *************************************/ static void keymap_item_modified(bContext *UNUSED(C), void *kmi_p, void *UNUSED(unused)) |