diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 27 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 9 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 4 |
7 files changed, 49 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 81f67bffd62..cb4fa8079ce 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -628,6 +628,10 @@ class USERPREF_PT_theme(Panel): col.label(text="Menu Back:") ui_items_general(col, ui) + ui = theme.user_interface.wcol_tooltip + col.label(text="Tooltip:") + ui_items_general(col, ui) + ui = theme.user_interface.wcol_menu_item col.label(text="Menu Item:") ui_items_general(col, ui) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index dd4bbc75249..fb244add82d 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -68,6 +68,7 @@ typedef enum { UI_WTYPE_NUMBER, UI_WTYPE_SLIDER, UI_WTYPE_EXEC, + UI_WTYPE_TOOLTIP, /* strings */ UI_WTYPE_NAME, @@ -84,7 +85,7 @@ typedef enum { UI_WTYPE_PULLDOWN, UI_WTYPE_MENU_ITEM, UI_WTYPE_MENU_BACK, - + /* specials */ UI_WTYPE_ICON, UI_WTYPE_SWATCH, @@ -465,6 +466,7 @@ extern int ui_button_is_active(struct ARegion *ar); void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); void ui_draw_anti_roundbox(int mode, float minx, float miny, float maxx, float maxy, float rad); void ui_draw_menu_back(struct uiStyle *style, uiBlock *block, rcti *rect); +void ui_draw_tooltip(uiStyle *UNUSED(style), uiBlock *block, rcti *rect); void ui_draw_search_back(struct uiStyle *style, uiBlock *block, rcti *rect); int ui_link_bezier_points(rcti *rect, float coord_array[][2], int resol); void ui_draw_link_bezier(rcti *rect); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index a5c1bc0e659..13ad5a15861 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -325,7 +325,7 @@ static void ui_tooltip_region_draw_cb(const bContext *UNUSED(C), ARegion *ar) rcti bbox= data->bbox; int a; - ui_draw_menu_back(UI_GetStyle(), NULL, &data->bbox); + ui_draw_tooltip(UI_GetStyle(), NULL, &data->bbox); /* draw text */ uiStyleFontSet(&data->fstyle); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 72bab289713..bd7b159ef13 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1390,6 +1390,19 @@ static struct uiWidgetColors wcol_menu_back= { 25, -20 }; +/* tooltip colour */ +static struct uiWidgetColors wcol_tooltip= { + {0, 0, 0, 255}, + {25, 25, 25, 230}, + {45, 45, 45, 230}, + {100, 100, 100, 255}, + + {160, 160, 160, 255}, + {255, 255, 255, 255}, + + 0, + 25, -20 +}; static struct uiWidgetColors wcol_radio= { {0, 0, 0, 255}, @@ -1524,6 +1537,7 @@ void ui_widget_color_init(ThemeUI *tui) tui->wcol_menu= wcol_menu; tui->wcol_pulldown= wcol_pulldown; tui->wcol_menu_back= wcol_menu_back; + tui->wcol_tooltip = wcol_tooltip; tui->wcol_menu_item= wcol_menu_item; tui->wcol_box= wcol_box; tui->wcol_scroll= wcol_scroll; @@ -2838,6 +2852,11 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) wt.wcol_theme= &btheme->tui.wcol_tool; wt.draw= widget_roundbut; break; + + case UI_WTYPE_TOOLTIP: + wt.wcol_theme = &btheme->tui.wcol_tooltip; + wt.draw = widget_menu_back; + break; /* strings */ @@ -3207,6 +3226,14 @@ void ui_draw_menu_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) } } +void ui_draw_tooltip(uiStyle *UNUSED(style), uiBlock *UNUSED(block), rcti *rect) +{ + uiWidgetType *wt = widget_type(UI_WTYPE_TOOLTIP); + wt->state(wt, 0); + /* wt->draw ends up using same function to draw the tooltip as menu_back */ + wt->draw(&wt->wcol, rect, 0, 0); +} + void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect) { uiWidgetType *wt= widget_type(UI_WTYPE_BOX); diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 5d4b1e6216e..f73a8f9d195 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1744,6 +1744,15 @@ void init_userdef_do_versions(void) } } + if (bmain->versionfile < 262 || (bmain->versionfile == 262 && bmain->subversionfile < 3)) { + bTheme *btheme; + for(btheme= U.themes.first; btheme; btheme= btheme->next) { + if (btheme->tui.wcol_tooltip.inner[3] == 0) { + btheme->tui.wcol_tooltip = btheme->tui.wcol_menu_back; + } + } + } + /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { U.texcollectrate = 60; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index e014e18d07b..157a45f0f00 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -151,7 +151,7 @@ typedef struct ThemeUI { uiWidgetColors wcol_regular, wcol_tool, wcol_text; uiWidgetColors wcol_radio, wcol_option, wcol_toggle; uiWidgetColors wcol_num, wcol_numslider; - uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item; + uiWidgetColors wcol_menu, wcol_pulldown, wcol_menu_back, wcol_menu_item, wcol_tooltip; uiWidgetColors wcol_box, wcol_scroll, wcol_progress, wcol_list_item; uiWidgetStateColors wcol_state; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 0cd1280e6a0..80ef320df65 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -698,6 +698,10 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text(prop, "Menu Backdrop Colors", ""); RNA_def_property_update(prop, 0, "rna_userdef_update"); + prop = RNA_def_property(srna, "wcol_tooltip", PROP_POINTER, PROP_NONE); + RNA_def_property_flag(prop, PROP_NEVER_NULL); + RNA_def_property_ui_text(prop, "Tooltip Colors", ""); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); |