Description:
Refactor Menu to use StyleSet.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r288:a14462495ea7 -

@@ -17,12 +17,13
17
17
18 if (active) {
18 if (active) {
19 ImGui.PushStyleColor(ImGuiCol.Button, activeColor);
19 ImGui.PushStyleColor(ImGuiCol.Button, activeColor);
20 ImGui.PushStyleColor(ImGuiCol.ButtonHovered, activeColor);
20 }
21 }
21
22
22 var result = ImGui.Button(label);
23 var result = ImGui.Button(label);
23
24
24 if (active) {
25 if (active) {
25 ImGui.PopStyleColor();
26 ImGui.PopStyleColor(2);
26 }
27 }
27
28
28 return result;
29 return result;
@@ -32,24 +33,11
32 ImGui.PushFont(font);
33 ImGui.PushFont(font);
33
34
34 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
35 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
35 ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 0.0f);
36 ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0.0f);
37 ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1.0f);
38 ImGui.PushStyleColor(ImGuiCol.WindowBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f));
39 ImGui.PushStyleColor(ImGuiCol.MenuBarBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f));
40 ImGui.PushStyleColor(ImGuiCol.PopupBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f));
41
42 ImGui.PushStyleColor(ImGuiCol.TitleBg, StyleSet.title_bar);
43 ImGui.PushStyleColor(ImGuiCol.TitleBgActive, StyleSet.title_bar);
44 ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, StyleSet.title_bar);
45
46 ImGui.PushStyleColor(ImGuiCol.Border, new Num.Vector4(0f, 0f, 0f, 1f));
47 ImGui.PushStyleColor(ImGuiCol.BorderShadow, new Num.Vector4(0f, 0f, 0f, 0.5f));
48
36
49
37
50
38 StyleSet.pushStyleVarSet(StyleSet.defaultWindowVars);
51 ImGui.PushStyleColor(ImGuiCol.Button, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f));
39 StyleSet.pushColorSet(StyleSet.defaultWindowColors);
52 ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f));
40 ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSet.grey);
53
41
54 if (ImGui.BeginMainMenuBar())
42 if (ImGui.BeginMainMenuBar())
55 {
43 {
@@ -119,8 +107,10
119
107
120 // ImGui.End();
108 // ImGui.End();
121 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
109 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
122 ImGui.PopStyleVar(3);
110
123 ImGui.PopStyleColor(9);
111 StyleSet.popStyleVarSet(StyleSet.defaultWindowVars);
112 StyleSet.popColorSet(StyleSet.defaultWindowColors);
113 ImGui.PopStyleColor(1);
124 ImGui.PopFont();
114 ImGui.PopFont();
125 }
115 }
126 }
116 }
You need to be logged in to leave comments. Login now