1+ #include < zest/settings/settings.h>
2+
13#include < nodegraph/canvas.h>
24#include < nodegraph/theme.h>
35#include < nodegraph/widgets/node.h>
@@ -13,39 +15,40 @@ Node::Node(const std::string& label)
1315
1416void Node::Draw (Canvas& canvas)
1517{
16- auto & theme = ThemeManager::Instance ();
18+ auto & settings = Zest::GlobalSettingsManager::Instance ();
19+ auto theme = settings.GetCurrentTheme ();
1720 Widget::Draw (canvas);
1821
1922 auto rcWorld = GetWorldRect ();
2023
2124 rcWorld = DrawSlab (canvas,
2225 rcWorld,
23- theme .GetFloat (s_nodeBorderRadius),
24- theme .GetFloat (s_nodeShadowSize),
25- theme .GetVec4f (c_nodeShadowColor),
26- theme .GetFloat (s_nodeBorderSize),
27- theme .GetVec4f (c_nodeBorderColor),
28- theme .GetVec4f (c_nodeCenterColor));
26+ settings .GetFloat (theme, s_nodeBorderRadius),
27+ settings .GetFloat (theme, s_nodeShadowSize),
28+ settings .GetVec4f (theme, c_nodeShadowColor),
29+ settings .GetFloat (theme, s_nodeBorderSize),
30+ settings .GetVec4f (theme, c_nodeBorderColor),
31+ settings .GetVec4f (theme, c_nodeCenterColor));
2932
30- auto fontSize = theme .GetFloat (s_nodeTitleSize);
31- auto titleHeight = fontSize + theme .GetFloat (s_nodeTitleFontPad) * 2 .0f ;
32- auto titlePad = theme .GetFloat (s_nodeTitlePad);
33+ auto fontSize = settings .GetFloat (theme, s_nodeTitleSize);
34+ auto titleHeight = fontSize + settings .GetFloat (theme, s_nodeTitleFontPad) * 2 .0f ;
35+ auto titlePad = settings .GetFloat (theme, s_nodeTitlePad);
3336
3437 auto titlePanelRect = NRectf (rcWorld.Left () + titlePad, rcWorld.Top () + titlePad, rcWorld.Width () - titlePad * 2 .0f , titleHeight);
3538
3639 rcWorld = DrawSlab (canvas,
3740 titlePanelRect,
38- theme .GetFloat (s_nodeTitleBorderRadius),
39- theme .GetFloat (s_nodeTitleShadowSize),
40- theme .GetVec4f (c_nodeTitleShadowColor),
41- theme .GetFloat (s_nodeTitleBorderSize),
42- theme .GetVec4f (c_nodeTitleBorderColor),
43- theme .GetVec4f (c_nodeTitleCenterColor),
41+ settings .GetFloat (theme, s_nodeTitleBorderRadius),
42+ settings .GetFloat (theme, s_nodeTitleShadowSize),
43+ settings .GetVec4f (theme, c_nodeTitleShadowColor),
44+ settings .GetFloat (theme, s_nodeTitleBorderSize),
45+ settings .GetVec4f (theme, c_nodeTitleBorderColor),
46+ settings .GetVec4f (theme, c_nodeTitleCenterColor),
4447 m_label.c_str (),
45- theme .GetFloat (s_nodeTitleFontPad),
46- TextColorForBackground (theme .GetVec4f (c_nodeTitleCenterColor)));
48+ settings .GetFloat (theme, s_nodeTitleFontPad),
49+ TextColorForBackground (settings .GetVec4f (theme, c_nodeTitleCenterColor)));
4750
48- auto bottomGap = theme .GetFloat (s_nodeBorderSize) + theme .GetFloat (s_nodeShadowSize);
51+ auto bottomGap = settings .GetFloat (theme, s_nodeBorderSize) + settings .GetFloat (theme, s_nodeShadowSize);
4952
5053 // Layout in child coordinates
5154 auto layoutRect = NRectf (titlePanelRect.Left (), titlePanelRect.Bottom (), titlePanelRect.Width (), GetWorldRect ().Bottom () - bottomGap - titlePanelRect.Bottom ());
0 commit comments