43 const float text[4] = {0.12f, 0.14f, 0.18f, 1.f};
44 const float textDisabled[4] = {0.45f, 0.48f, 0.52f, 1.f};
45 const float windowBg[4] = {0.94f, 0.95f, 0.97f, 1.f};
46 const float childBg[4] = {0.90f, 0.92f, 0.95f, 1.f};
47 const float popupBg[4] = {0.98f, 0.98f, 0.99f, 0.98f};
48 const float border[4] = {0.55f, 0.58f, 0.62f, 0.55f};
49 const float frameBg[4] = {0.86f, 0.88f, 0.92f, 1.f};
52 const float titleBg[4] = {0.88f, 0.90f, 0.94f, 1.f};
55 const float button[4] = {0.26f, 0.52f, 0.90f, 0.65f};
57 const float buttonActive[4] = {0.18f, 0.42f, 0.82f, 1.f};
58 const float header[4] = {0.26f, 0.52f, 0.90f, 0.35f};
60 const float headerActive[4] = {0.26f, 0.52f, 0.90f, 0.80f};
61 const float checkMark[4] = {0.18f, 0.42f, 0.82f, 1.f};
62 const float sliderGrab[4] = {0.30f, 0.55f, 0.92f, 0.90f};
64 const float separator[4] = {0.60f, 0.62f, 0.66f, 0.55f};
65 const float scrollbarBg[4] = {0.85f, 0.87f, 0.90f, 0.60f};
138 ImGuiContext *ctx = ImGui::GetCurrentContext();
141 uiScale = std::clamp(uiScale, 0.5f, 5.f);
142 const float s = uiScale;
144 ImGuiStyle &style = ImGui::GetStyle();
147 setCol(style, ImGuiCol_Text,
theme.text);
148 setCol(style, ImGuiCol_TextDisabled,
theme.textDisabled);
149 setCol(style, ImGuiCol_WindowBg,
theme.windowBg);
150 setCol(style, ImGuiCol_ChildBg,
theme.childBg);
151 setCol(style, ImGuiCol_PopupBg,
theme.popupBg);
152 setCol(style, ImGuiCol_Border,
theme.border);
153 setCol(style, ImGuiCol_FrameBg,
theme.frameBg);
154 setCol(style, ImGuiCol_FrameBgHovered,
theme.frameBgHovered);
155 setCol(style, ImGuiCol_FrameBgActive,
theme.frameBgActive);
156 setCol(style, ImGuiCol_TitleBg,
theme.titleBg);
157 setCol(style, ImGuiCol_TitleBgActive,
theme.titleBgActive);
158 setCol(style, ImGuiCol_TitleBgCollapsed,
theme.titleBgCollapsed);
159 setCol(style, ImGuiCol_Button,
theme.button);
160 setCol(style, ImGuiCol_ButtonHovered,
theme.buttonHovered);
161 setCol(style, ImGuiCol_ButtonActive,
theme.buttonActive);
162 setCol(style, ImGuiCol_Header,
theme.header);
163 setCol(style, ImGuiCol_HeaderHovered,
theme.headerHovered);
164 setCol(style, ImGuiCol_HeaderActive,
theme.headerActive);
165 setCol(style, ImGuiCol_CheckMark,
theme.checkMark);
166 setCol(style, ImGuiCol_SliderGrab,
theme.sliderGrab);
167 setCol(style, ImGuiCol_SliderGrabActive,
theme.sliderGrabActive);
168 setCol(style, ImGuiCol_Separator,
theme.separator);
169 setCol(style, ImGuiCol_ScrollbarBg,
theme.scrollbarBg);
170 setCol(style, ImGuiCol_ScrollbarGrab,
theme.scrollbarGrab);
171 setCol(style, ImGuiCol_ScrollbarGrabHovered,
theme.scrollbarGrabHovered);
172 setCol(style, ImGuiCol_ScrollbarGrabActive,
theme.scrollbarGrabActive);
175 style.WindowRounding =
theme.windowRounding *
s;
176 style.ChildRounding =
theme.childRounding *
s;
177 style.FrameRounding =
theme.frameRounding *
s;
178 style.PopupRounding =
theme.popupRounding *
s;
179 style.ScrollbarRounding =
theme.scrollbarRounding *
s;
180 style.GrabRounding =
theme.grabRounding *
s;
181 style.TabRounding =
theme.tabRounding *
s;
183 style.WindowBorderSize =
theme.windowBorderSize *
s;
184 style.ChildBorderSize =
theme.childBorderSize *
s;
185 style.PopupBorderSize =
theme.popupBorderSize *
s;
186 style.FrameBorderSize =
theme.frameBorderSize *
s;
188 style.WindowPadding = ImVec2(
theme.windowPaddingX *
s,
theme.windowPaddingY *
s);
189 style.FramePadding = ImVec2(
theme.framePaddingX *
s,
theme.framePaddingY *
s);
190 style.ItemSpacing = ImVec2(
theme.itemSpacingX *
s,
theme.itemSpacingY *
s);
191 style.ItemInnerSpacing = ImVec2(
theme.itemInnerSpacingX *
s,
theme.itemInnerSpacingY *
s);
192 style.IndentSpacing =
theme.indentSpacing *
s;
193 style.ScrollbarSize =
theme.scrollbarSize *
s;
194 style.GrabMinSize =
theme.grabMinSize *
s;
196 ImGuiIO &io = ImGui::GetIO();
204 const float dpi = std::clamp(g_dpiScale, 1.f, 5.f);
205 io.FontGlobalScale =
theme.fontScale * (
s / dpi);
207 if (
theme.navEnableKeyboard) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
208 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableKeyboard;
209 if (
theme.navEnableGamepad) io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
210 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;