@@ -96,80 +96,11 @@ bool EditorSystem::initialize(const JSON::json& systemData)
9696 }
9797 ImGui_ImplWin32_Init (Application::GetSingleton ()->getWindow ()->getWindowHandle ());
9898 ImGui_ImplDX11_Init (RenderingDevice::GetSingleton ()->getDevice (), RenderingDevice::GetSingleton ()->getContext ());
99- ImGui::StyleColorsDark ();
100-
101- {
102- ImGuiStyle& style = ImGui::GetStyle ();
103- style.WindowPadding = ImVec2 (15 , 15 );
104- style.WindowRounding = 5 .0f ;
105- style.FramePadding = ImVec2 (5 , 5 );
106- style.FrameRounding = 4 .0f ;
107- style.ItemSpacing = ImVec2 (12 , 6 );
108- style.ItemInnerSpacing = ImVec2 (8 , 4 );
109- style.IndentSpacing = 25 .0f ;
110- style.ScrollbarSize = 15 .0f ;
111- style.ScrollbarRounding = 9 .0f ;
112- style.GrabMinSize = 5 .0f ;
113- style.GrabRounding = 3 .0f ;
114-
115- ImVec4* colors = ImGui::GetStyle ().Colors ;
116- colors[ImGuiCol_Text] = ImVec4 (0 .80f , 0 .80f , 0 .83f , 1 .00f );
117- colors[ImGuiCol_TextDisabled] = ImVec4 (0 .24f , 0 .23f , 0 .29f , 1 .00f );
118- colors[ImGuiCol_WindowBg] = ImVec4 (0 .05f , 0 .05f , 0 .07f , 1 .00f );
119- colors[ImGuiCol_ChildBg] = ImVec4 (0 .07f , 0 .07f , 0 .09f , 1 .00f );
120- colors[ImGuiCol_PopupBg] = ImVec4 (0 .14f , 0 .14f , 0 .14f , 1 .00f );
121- colors[ImGuiCol_Border] = ImVec4 (0 .23f , 0 .23f , 0 .23f , 1 .00f );
122- colors[ImGuiCol_BorderShadow] = ImVec4 (0 .68f , 0 .63f , 0 .63f , 1 .00f );
123- colors[ImGuiCol_FrameBg] = ImVec4 (0 .10f , 0 .09f , 0 .12f , 1 .00f );
124- colors[ImGuiCol_FrameBgHovered] = ImVec4 (0 .24f , 0 .23f , 0 .29f , 1 .00f );
125- colors[ImGuiCol_FrameBgActive] = ImVec4 (0 .56f , 0 .56f , 0 .58f , 1 .00f );
126- colors[ImGuiCol_TitleBg] = ImVec4 (0 .10f , 0 .09f , 0 .12f , 1 .00f );
127- colors[ImGuiCol_TitleBgActive] = ImVec4 (0 .07f , 0 .07f , 0 .09f , 1 .00f );
128- colors[ImGuiCol_TitleBgCollapsed] = ImVec4 (1 .00f , 0 .98f , 0 .95f , 0 .75f );
129- colors[ImGuiCol_MenuBarBg] = ImVec4 (0 .10f , 0 .09f , 0 .12f , 1 .00f );
130- colors[ImGuiCol_ScrollbarBg] = ImVec4 (0 .10f , 0 .09f , 0 .12f , 1 .00f );
131- colors[ImGuiCol_ScrollbarGrab] = ImVec4 (0 .80f , 0 .80f , 0 .83f , 0 .31f );
132- colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4 (0 .56f , 0 .56f , 0 .58f , 1 .00f );
133- colors[ImGuiCol_ScrollbarGrabActive] = ImVec4 (0 .06f , 0 .05f , 0 .07f , 1 .00f );
134- colors[ImGuiCol_CheckMark] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .83f );
135- colors[ImGuiCol_SliderGrab] = ImVec4 (0 .80f , 0 .80f , 0 .83f , 0 .31f );
136- colors[ImGuiCol_SliderGrabActive] = ImVec4 (0 .06f , 0 .05f , 0 .07f , 1 .00f );
137- colors[ImGuiCol_Button] = ImVec4 (0 .12f , 0 .43f , 0 .33f , 0 .88f );
138- colors[ImGuiCol_ButtonHovered] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .83f );
139- colors[ImGuiCol_ButtonActive] = ImVec4 (0 .56f , 0 .56f , 0 .58f , 1 .00f );
140- colors[ImGuiCol_Header] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .58f );
141- colors[ImGuiCol_HeaderHovered] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .83f );
142- colors[ImGuiCol_HeaderActive] = ImVec4 (0 .06f , 0 .05f , 0 .07f , 1 .00f );
143- colors[ImGuiCol_Separator] = ImVec4 (0 .43f , 0 .43f , 0 .50f , 0 .50f );
144- colors[ImGuiCol_SeparatorHovered] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .83f );
145- colors[ImGuiCol_SeparatorActive] = ImVec4 (0 .36f , 0 .75f , 0 .10f , 1 .00f );
146- colors[ImGuiCol_ResizeGrip] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 0 .00f );
147- colors[ImGuiCol_ResizeGripHovered] = ImVec4 (0 .56f , 0 .56f , 0 .58f , 1 .00f );
148- colors[ImGuiCol_ResizeGripActive] = ImVec4 (0 .06f , 0 .05f , 0 .07f , 1 .00f );
149- colors[ImGuiCol_Tab] = ImVec4 (0 .18f , 0 .57f , 0 .58f , 0 .86f );
150- colors[ImGuiCol_TabHovered] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 0 .83f );
151- colors[ImGuiCol_TabActive] = ImVec4 (0 .20f , 0 .68f , 0 .42f , 1 .00f );
152- colors[ImGuiCol_TabUnfocused] = ImVec4 (0 .14f , 0 .41f , 0 .42f , 0 .46f );
153- colors[ImGuiCol_TabUnfocusedActive] = ImVec4 (0 .14f , 0 .41f , 0 .42f , 1 .00f );
154- colors[ImGuiCol_DockingPreview] = ImVec4 (0 .00f , 1 .00f , 0 .21f , 0 .70f );
155- colors[ImGuiCol_DockingEmptyBg] = ImVec4 (0 .20f , 0 .20f , 0 .20f , 1 .00f );
156- colors[ImGuiCol_PlotLines] = ImVec4 (0 .40f , 0 .39f , 0 .38f , 0 .63f );
157- colors[ImGuiCol_PlotLinesHovered] = ImVec4 (0 .25f , 1 .00f , 0 .00f , 1 .00f );
158- colors[ImGuiCol_PlotHistogram] = ImVec4 (0 .40f , 0 .39f , 0 .38f , 0 .63f );
159- colors[ImGuiCol_PlotHistogramHovered] = ImVec4 (0 .25f , 1 .00f , 0 .00f , 1 .00f );
160- colors[ImGuiCol_TableHeaderBg] = ImVec4 (0 .19f , 0 .19f , 0 .20f , 1 .00f );
161- colors[ImGuiCol_TableBorderStrong] = ImVec4 (0 .31f , 0 .31f , 0 .35f , 1 .00f );
162- colors[ImGuiCol_TableBorderLight] = ImVec4 (0 .23f , 0 .23f , 0 .25f , 1 .00f );
163- colors[ImGuiCol_TableRowBg] = ImVec4 (0 .00f , 0 .00f , 0 .00f , 0 .00f );
164- colors[ImGuiCol_TableRowBgAlt] = ImVec4 (1 .00f , 1 .00f , 1 .00f , 0 .06f );
165- colors[ImGuiCol_TextSelectedBg] = ImVec4 (0 .25f , 1 .00f , 0 .00f , 0 .48f );
166- colors[ImGuiCol_DragDropTarget] = ImVec4 (1 .00f , 1 .00f , 0 .00f , 0 .90f );
167- colors[ImGuiCol_NavHighlight] = ImVec4 (1 .00f , 1 .00f , 1 .00f , 1 .00f );
168- colors[ImGuiCol_NavWindowingHighlight] = ImVec4 (1 .00f , 1 .00f , 1 .00f , 0 .70f );
169- colors[ImGuiCol_NavWindowingDimBg] = ImVec4 (0 .80f , 0 .80f , 0 .80f , 0 .20f );
170- colors[ImGuiCol_ModalWindowDimBg] = ImVec4 (1 .00f , 0 .98f , 0 .95f , 0 .73f );
171- }
172-
99+
100+ m_Themes.push_back (std::make_unique<DarkTheme>());
101+ m_CurrentTheme = m_Themes.front ().get ();
102+ m_CurrentTheme->apply ();
103+
173104 return true ;
174105}
175106
@@ -416,6 +347,19 @@ void EditorSystem::drawDefaultUI(float deltaMilliseconds)
416347 static bool styleEditor = false ;
417348 if (ImGui::BeginMenu (" View" ))
418349 {
350+ if (ImGui::BeginMenu (" Theme" ))
351+ {
352+ for (auto & theme : m_Themes)
353+ {
354+ if (ImGui::MenuItem (theme->getName ().c_str (), " " , m_CurrentTheme == theme.get ()))
355+ {
356+ m_CurrentTheme = theme.get ();
357+ m_CurrentTheme->apply ();
358+ }
359+ }
360+ ImGui::EndMenu ();
361+ }
362+
419363 if (ImGui::Checkbox (" Wireframe Mode" , &m_WireframeMode))
420364 {
421365 if (m_WireframeMode)
0 commit comments