diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-09 11:13:20 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-09 11:15:41 +0300 |
commit | 6a5b636b562994d7941666482ee020e6ad3bb0bb (patch) | |
tree | 8c43874a7e200d041152a47619b5ca00d6f1b8e1 /source/blender/editors | |
parent | 01d3afaf3dec8c77c7c4de9f25ed50931ecd49a0 (diff) |
Cleanup: remove button flag for forced tool-tips
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 13 |
2 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 89c50a46c70..a2408812643 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -179,10 +179,9 @@ enum { UI_BUT_DRAG_MULTI = (1 << 25), /* edit this button as well as the active button (not just dragging) */ UI_BUT_SCA_LINK_GREY = (1 << 26), /* used to flag if sca links shoud be gray out */ UI_BUT_HAS_SEP_CHAR = (1 << 27), /* but->str contains UI_SEP_CHAR, used for key shortcuts */ - UI_BUT_TIP_FORCE = (1 << 28), /* force show tooltips when holding option/alt if U's USER_TOOLTIPS is off */ + UI_BUT_UPDATE_DELAY = (1 << 28), /* don't run updates while dragging (needed in rare cases). */ UI_BUT_TEXTEDIT_UPDATE = (1 << 29), /* when widget is in textedit mode, update value on each char stroke */ UI_BUT_SEARCH_UNLINK = (1 << 30), /* show unlink for search button */ - UI_BUT_UPDATE_DELAY = (1 << 31), /* don't run updates while dragging (needed in rare cases). */ }; #define UI_PANEL_WIDTH 340 diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index bccecdee056..1a099f07519 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -296,6 +296,7 @@ typedef struct uiHandleButtonData { /* tooltip */ ARegion *tooltip; wmTimer *tooltiptimer; + unsigned int tooltip_force : 1; /* auto open */ bool used_mouse; @@ -7603,7 +7604,7 @@ static void button_tooltip_timer_reset(bContext *C, uiBut *but) data->tooltiptimer = NULL; } - if ((U.flag & USER_TOOLTIPS) || (but->flag & UI_BUT_TIP_FORCE)) { + if ((U.flag & USER_TOOLTIPS) || (data->tooltip_force)) { if (!but->block->tooltipdisabled) { if (!wm->drags.first) { data->tooltiptimer = WM_event_add_timer(data->wm, data->window, TIMER, BUTTON_TOOLTIP_DELAY); @@ -8131,14 +8132,12 @@ static int ui_handle_button_over(bContext *C, const wmEvent *event, ARegion *ar) if (event->type == MOUSEMOVE) { but = ui_but_find_mouse_over(ar, event); if (but) { - if (event->alt) { + button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER); + + if (event->alt && but->active) { /* display tooltips if holding alt on mouseover when tooltips are off in prefs */ - but->flag |= UI_BUT_TIP_FORCE; + but->active->tooltip_force = true; } - else { - but->flag &= ~UI_BUT_TIP_FORCE; - } - button_activate_init(C, ar, but, BUTTON_ACTIVATE_OVER); } } else if (event->type == EVT_BUT_OPEN) { |