[Bf-blender-cvs] [a8b5658437a] blender2.8: UI: Node Link Menu to use same colors as regular menus
Pablo Vazquez
noreply at git.blender.org
Wed Jul 4 18:00:13 CEST 2018
Commit: a8b5658437a690977904bf3259ae82afcaaa478f
Author: Pablo Vazquez
Date: Wed Jul 4 18:00:03 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa8b5658437a690977904bf3259ae82afcaaa478f
UI: Node Link Menu to use same colors as regular menus
Node link menus (like shader settings in Material properties) used a slightly
brighter variant of the menu widget. Making it hard to style and match the rest.
Make it use widget_menuiconbut, which is just the menu widget with an icon and no arrows.
Thanks Brecht for the help!
===================================================================
M source/blender/editors/interface/interface_widgets.c
===================================================================
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d5e152ccc79..19aff48e2c1 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3458,30 +3458,6 @@ static void widget_menuiconbut(uiWidgetColors *wcol, rcti *rect, int UNUSED(stat
widgetbase_draw(&wtb, wcol);
}
-static void widget_menunodebut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
-{
- /* silly node link button hacks */
- uiWidgetBase wtb;
- uiWidgetColors wcol_backup = *wcol;
- float rad;
-
- widget_init(&wtb);
-
- rad = wcol->roundness * U.widget_unit;
- round_box_edges(&wtb, roundboxalign, rect, rad);
-
- wcol->inner[0] = min_ii(wcol->inner[0] + 15, 255);
- wcol->inner[1] = min_ii(wcol->inner[1] + 15, 255);
- wcol->inner[2] = min_ii(wcol->inner[2] + 15, 255);
- wcol->outline[0] = min_ii(wcol->outline[0] + 15, 255);
- wcol->outline[1] = min_ii(wcol->outline[1] + 15, 255);
- wcol->outline[2] = min_ii(wcol->outline[2] + 15, 255);
-
- /* decoration */
- widgetbase_draw(&wtb, wcol);
- *wcol = wcol_backup;
-}
-
static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
float back[4];
@@ -3882,6 +3858,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
break;
case UI_WTYPE_MENU_ICON_RADIO:
+ case UI_WTYPE_MENU_NODE_LINK:
wt.wcol_theme = &btheme->tui.wcol_menu;
wt.draw = widget_menuiconbut;
break;
@@ -3891,11 +3868,6 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
wt.draw = widget_menubut;
break;
- case UI_WTYPE_MENU_NODE_LINK:
- wt.wcol_theme = &btheme->tui.wcol_menu;
- wt.draw = widget_menunodebut;
- break;
-
case UI_WTYPE_PULLDOWN:
wt.wcol_theme = &btheme->tui.wcol_pulldown;
wt.draw = widget_pulldownbut;
More information about the Bf-blender-cvs
mailing list