diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-26 22:17:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-26 22:18:27 +0300 |
commit | 226c757b4400b9b423b691a4309f6daf56f775c7 (patch) | |
tree | 4e2afc3c68686a73864a7868751676af5ca60db8 /source/blender/editors/interface/interface_widgets.c | |
parent | 918359269824a081c5e5819c44bc8461f59ebd37 (diff) |
UI: add darker theme color for toolbar items
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 1ce4941554c..10e4b03acef 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2317,6 +2317,22 @@ static struct uiWidgetColors wcol_tool = { 0.2f, }; +static struct uiWidgetColors wcol_toolbar_item = { + .outline = {0x19, 0x19, 0x19, 0xff}, + .inner = {0x46, 0x46, 0x46, 0xff}, + .inner_sel = {0xb4, 0xb4, 0xb4, 0xff}, + .item = {0x19, 0x19, 0x19, 0xff}, + + .text = {0xff, 0xff, 0xff, 0xff}, + .text_sel = {0x33, 0x33, 0x33, 0xff}, + + .shaded = 0, + .shadetop = 0, + .shadedown = 0, + .alpha_check = 0, + .roundness = 0.3f, +}; + static struct uiWidgetColors wcol_box = { {25, 25, 25, 255}, {128, 128, 128, 255}, @@ -2429,6 +2445,7 @@ void ui_widget_color_init(ThemeUI *tui) { tui->wcol_regular = wcol_regular; tui->wcol_tool = wcol_tool; + tui->wcol_toolbar_item = wcol_toolbar_item; tui->wcol_text = wcol_text; tui->wcol_radio = wcol_radio; tui->wcol_tab = wcol_tab; @@ -4172,6 +4189,11 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type) wt.draw = widget_roundbut_exec; break; + case UI_WTYPE_TOOLBAR_ITEM: + wt.wcol_theme = &btheme->tui.wcol_toolbar_item; + wt.draw = widget_roundbut_exec; + break; + case UI_WTYPE_TAB: wt.wcol_theme = &btheme->tui.wcol_tab; wt.draw = widget_tab; @@ -4415,7 +4437,16 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct break; case UI_BTYPE_BUT: +#ifdef USE_TOOLBAR_HACK + if (UI_but_is_tool(but)) { + wt = widget_type(UI_WTYPE_TOOLBAR_ITEM); + } + else { + wt = widget_type(UI_WTYPE_EXEC); + } +#else wt = widget_type(UI_WTYPE_EXEC); +#endif break; case UI_BTYPE_NUM: |