UI: change tool-tips to be stored in the screen

Move timer and tip out of button code,
now the only requests a tooltip,
passing a creation callback to run.

Needed for manipulators in 2.8,
also helps de-duplicate logic - since we never want
multiple tool-tips showing at once.
This commit is contained in:
2018-01-25 16:17:25 +11:00
parent 9b32248894
commit 693b41eb17
11 changed files with 187 additions and 44 deletions

View File

@@ -1081,6 +1081,8 @@ void UI_context_active_but_prop_get_templateID(
struct bContext *C,
struct PointerRNA *r_ptr, struct PropertyRNA **r_prop);
uiBut *UI_region_active_but_get(struct ARegion *ar);
/* Styled text draw */
void UI_fontstyle_set(const struct uiFontStyle *fs);
void UI_fontstyle_draw_ex(
@@ -1124,7 +1126,7 @@ void UI_butstore_unregister(uiButStore *bs_handle, uiBut **but_p);
/* ui_interface_region_tooltip.c */
struct ARegion *UI_tooltip_create_from_button(struct bContext *C, struct ARegion *butregion, uiBut *but);
void UI_tooltip_free(struct bContext *C, struct ARegion *ar);
void UI_tooltip_free(struct bContext *C, struct bScreen *sc, struct ARegion *ar);
/* How long before a tool-tip shows. */
#define UI_TOOLTIP_DELAY 0.5