diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 06:52:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-09-05 06:52:19 +0300 |
commit | 6f1f7296f4cf69602f599dda92e0590593f4cc62 (patch) | |
tree | 2c9f1de02f5202099b22af099b60b14034529861 /source/blender/windowmanager/intern/wm_tooltip.c | |
parent | e1751415dc9a2c5287bda8116f501a6fb2d55a1a (diff) |
UI: show a small label next to the tool
Instead of showing the full tip immediately when hovering over a tool,
show only the (label, shortcut), without suppressing the regular tip.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_tooltip.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_tooltip.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_tooltip.c b/source/blender/windowmanager/intern/wm_tooltip.c index 0953351de2b..58c657bf116 100644 --- a/source/blender/windowmanager/intern/wm_tooltip.c +++ b/source/blender/windowmanager/intern/wm_tooltip.c @@ -37,9 +37,24 @@ #include "WM_api.h" #include "WM_types.h" +void WM_tooltip_immediate_init( + bContext *C, wmWindow *win, ARegion *ar, + wmTooltipInitFn init) +{ + WM_tooltip_timer_clear(C, win); + + bScreen *screen = WM_window_get_active_screen(win); + if (screen->tool_tip == NULL) { + screen->tool_tip = MEM_callocN(sizeof(*screen->tool_tip), __func__); + } + screen->tool_tip->region_from = ar; + screen->tool_tip->init = init; + WM_tooltip_init(C, win); +} + void WM_tooltip_timer_init( bContext *C, wmWindow *win, ARegion *ar, - wmTooltipInitFn init, bool quick) + wmTooltipInitFn init) { WM_tooltip_timer_clear(C, win); @@ -50,7 +65,7 @@ void WM_tooltip_timer_init( } screen->tool_tip->region_from = ar; screen->tool_tip->timer = WM_event_add_timer( - wm, win, TIMER, quick ? UI_TOOLTIP_DELAY_QUICK : UI_TOOLTIP_DELAY); + wm, win, TIMER, UI_TOOLTIP_DELAY); screen->tool_tip->init = init; } |