183 const float text[4] = {0.12f, 0.14f, 0.18f, 1.f};
184 const float textDisabled[4] = {0.45f, 0.48f, 0.52f, 1.f};
185 const float windowBg[4] = {0.94f, 0.95f, 0.97f, 1.f};
186 const float childBg[4] = {0.90f, 0.92f, 0.95f, 1.f};
187 const float popupBg[4] = {0.98f, 0.98f, 0.99f, 0.98f};
188 const float border[4] = {0.55f, 0.58f, 0.62f, 0.55f};
190 const float frameBg[4] = {0.86f, 0.88f, 0.92f, 1.f};
193 const float titleBg[4] = {0.88f, 0.90f, 0.94f, 1.f};
196 const float menuBarBg[4] = {0.90f, 0.92f, 0.95f, 1.f};
197 const float button[4] = {0.26f, 0.52f, 0.90f, 0.65f};
199 const float buttonActive[4] = {0.18f, 0.42f, 0.82f, 1.f};
200 const float header[4] = {0.26f, 0.52f, 0.90f, 0.35f};
202 const float headerActive[4] = {0.26f, 0.52f, 0.90f, 0.80f};
203 const float checkMark[4] = {0.18f, 0.42f, 0.82f, 1.f};
204 const float sliderGrab[4] = {0.30f, 0.55f, 0.92f, 0.90f};
206 const float separator[4] = {0.60f, 0.62f, 0.66f, 0.55f};
207 const float scrollbarBg[4] = {0.85f, 0.87f, 0.90f, 0.60f};
211 const float tab[4] = {0.86f, 0.89f, 0.93f, 1.f};
212 const float tabHovered[4] = {0.68f, 0.84f, 0.91f, 1.f};
213 const float tabActive[4] = {0.76f, 0.87f, 0.92f, 1.f};
214 const float tabUnfocused[4] = {0.89f, 0.91f, 0.94f, 1.f};
219 const float tableRowBg[4] = {0.f, 0.f, 0.f, 0.f};
221 const float plotLines[4] = {0.38f, 0.43f, 0.49f, 1.f};
226 const float navHighlight[4] = {0.12f, 0.48f, 0.62f, 0.82f};
227 const float modalDimBg[4] = {0.10f, 0.13f, 0.17f, 0.38f};
316 ImGuiContext *ctx = ImGui::GetCurrentContext();
319 uiScale = std::clamp(uiScale, 0.5f, 5.f);
320 const float s = uiScale;
322 ImGuiStyle &style = ImGui::GetStyle();
325 setCol(style, ImGuiCol_Text,
theme.text);
326 setCol(style, ImGuiCol_TextDisabled,
theme.textDisabled);
327 setCol(style, ImGuiCol_WindowBg,
theme.windowBg);
328 setCol(style, ImGuiCol_ChildBg,
theme.childBg);
329 setCol(style, ImGuiCol_PopupBg,
theme.popupBg);
330 setCol(style, ImGuiCol_Border,
theme.border);
331 setCol(style, ImGuiCol_BorderShadow,
theme.borderShadow);
332 setCol(style, ImGuiCol_FrameBg,
theme.frameBg);
333 setCol(style, ImGuiCol_FrameBgHovered,
theme.frameBgHovered);
334 setCol(style, ImGuiCol_FrameBgActive,
theme.frameBgActive);
335 setCol(style, ImGuiCol_TitleBg,
theme.titleBg);
336 setCol(style, ImGuiCol_TitleBgActive,
theme.titleBgActive);
337 setCol(style, ImGuiCol_TitleBgCollapsed,
theme.titleBgCollapsed);
338 setCol(style, ImGuiCol_MenuBarBg,
theme.menuBarBg);
339 setCol(style, ImGuiCol_Button,
theme.button);
340 setCol(style, ImGuiCol_ButtonHovered,
theme.buttonHovered);
341 setCol(style, ImGuiCol_ButtonActive,
theme.buttonActive);
342 setCol(style, ImGuiCol_Header,
theme.header);
343 setCol(style, ImGuiCol_HeaderHovered,
theme.headerHovered);
344 setCol(style, ImGuiCol_HeaderActive,
theme.headerActive);
345 setCol(style, ImGuiCol_CheckMark,
theme.checkMark);
346 setCol(style, ImGuiCol_SliderGrab,
theme.sliderGrab);
347 setCol(style, ImGuiCol_SliderGrabActive,
theme.sliderGrabActive);
348 setCol(style, ImGuiCol_Separator,
theme.separator);
349 setCol(style, ImGuiCol_SeparatorHovered,
theme.headerHovered);
350 setCol(style, ImGuiCol_SeparatorActive,
theme.headerActive);
351 setCol(style, ImGuiCol_ScrollbarBg,
theme.scrollbarBg);
352 setCol(style, ImGuiCol_ScrollbarGrab,
theme.scrollbarGrab);
353 setCol(style, ImGuiCol_ScrollbarGrabHovered,
theme.scrollbarGrabHovered);
354 setCol(style, ImGuiCol_ScrollbarGrabActive,
theme.scrollbarGrabActive);
355 setCol(style, ImGuiCol_ResizeGrip,
theme.button);
356 setCol(style, ImGuiCol_ResizeGripHovered,
theme.buttonHovered);
357 setCol(style, ImGuiCol_ResizeGripActive,
theme.buttonActive);
358 setCol(style, ImGuiCol_Tab,
theme.tab);
359 setCol(style, ImGuiCol_TabHovered,
theme.tabHovered);
360 setCol(style, ImGuiCol_TabActive,
theme.tabActive);
361 setCol(style, ImGuiCol_TabUnfocused,
theme.tabUnfocused);
362 setCol(style, ImGuiCol_TabUnfocusedActive,
theme.tabUnfocusedActive);
363 setCol(style, ImGuiCol_PlotLines,
theme.plotLines);
364 setCol(style, ImGuiCol_PlotLinesHovered,
theme.plotLinesHovered);
365 setCol(style, ImGuiCol_PlotHistogram,
theme.plotHistogram);
366 setCol(style, ImGuiCol_PlotHistogramHovered,
theme.plotHistogramHovered);
367 setCol(style, ImGuiCol_TableHeaderBg,
theme.tableHeaderBg);
368 setCol(style, ImGuiCol_TableBorderStrong,
theme.tableBorderStrong);
369 setCol(style, ImGuiCol_TableBorderLight,
theme.tableBorderLight);
370 setCol(style, ImGuiCol_TableRowBg,
theme.tableRowBg);
371 setCol(style, ImGuiCol_TableRowBgAlt,
theme.tableRowBgAlt);
372 setCol(style, ImGuiCol_TextSelectedBg,
theme.textSelectedBg);
373 setCol(style, ImGuiCol_DragDropTarget,
theme.checkMark);
374 setCol(style, ImGuiCol_NavHighlight,
theme.navHighlight);
375 setCol(style, ImGuiCol_NavWindowingHighlight,
theme.text);
376 setCol(style, ImGuiCol_NavWindowingDimBg,
theme.modalDimBg);
377 setCol(style, ImGuiCol_ModalWindowDimBg,
theme.modalDimBg);
380 style.WindowRounding =
theme.windowRounding *
s;
381 style.ChildRounding =
theme.childRounding *
s;
382 style.FrameRounding =
theme.frameRounding *
s;
383 style.PopupRounding =
theme.popupRounding *
s;
384 style.ScrollbarRounding =
theme.scrollbarRounding *
s;
385 style.GrabRounding =
theme.grabRounding *
s;
386 style.TabRounding =
theme.tabRounding *
s;
388 style.WindowBorderSize =
theme.windowBorderSize *
s;
389 style.ChildBorderSize =
theme.childBorderSize *
s;
390 style.PopupBorderSize =
theme.popupBorderSize *
s;
391 style.FrameBorderSize =
theme.frameBorderSize *
s;
393 style.WindowPadding = ImVec2(
theme.windowPaddingX *
s,
theme.windowPaddingY *
s);
394 style.FramePadding = ImVec2(
theme.framePaddingX *
s,
theme.framePaddingY *
s);
395 style.ItemSpacing = ImVec2(
theme.itemSpacingX *
s,
theme.itemSpacingY *
s);
396 style.ItemInnerSpacing = ImVec2(
theme.itemInnerSpacingX *
s,
theme.itemInnerSpacingY *
s);
397 style.CellPadding = ImVec2(
theme.cellPaddingX *
s,
theme.cellPaddingY *
s);
398 style.IndentSpacing =
theme.indentSpacing *
s;
399 style.ScrollbarSize =
theme.scrollbarSize *
s;
400 style.GrabMinSize =
theme.grabMinSize *
s;
402 ImGuiIO &io = ImGui::GetIO();
410 const float dpi = std::clamp(g_dpiScale, 1.f, 5.f);
411 io.FontGlobalScale =
theme.fontScale * (
s / dpi);
413 if (
theme.navEnableKeyboard) io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
414 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableKeyboard;
415 if (
theme.navEnableGamepad) io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
416 else io.ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad;