Skip to content

Commit 8cf5d37

Browse files
committed
:style(userInterface): update theme selector
1 parent 46836e0 commit 8cf5d37

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎src/userInterface.cpp‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ namespace mathplotter {
3636
void UserInterface::SelectTheme([[maybe_unused]]Theme& theme) {
3737
const ImGuiViewport* viewport{ImGui::GetMainViewport()};
3838
const ImVec2 position{
39-
viewport->WorkPos.x + viewport->WorkSize.x - 5.f,
40-
viewport->WorkPos.y + viewport->WorkSize.y - 5.f
39+
viewport->WorkPos.x + viewport->WorkSize.x - 10.f,
40+
viewport->WorkPos.y + 10.f
4141
};
4242
ImGui::SetNextWindowPos(
4343
position,
4444
ImGuiCond_Always,
45-
{1.f, 1.f}
45+
{1.f, 0.f}
4646
);
4747
const float comboWidth{
4848
ImGui::CalcTextSize("Light").x +
@@ -57,7 +57,12 @@ namespace mathplotter {
5757
ImGuiWindowFlags_AlwaysAutoResize
5858
};
5959
ImGuiStyle& style{ImGui::GetStyle()};
60+
ImGui::PushStyleVar(
61+
ImGuiStyleVar_WindowPadding,
62+
{0.f, 0.f}
63+
);
6064
ImGui::Begin("Theme", nullptr, windowFlags);
65+
ImGui::PopStyleVar();
6166

6267
const char* themes[]{"Light", "Dark", "Matrix"};
6368

@@ -88,9 +93,9 @@ namespace mathplotter {
8893
style.Colors[ImGuiCol_ButtonActive] = active;
8994
style.Colors[ImGuiCol_HeaderHovered] = hovered;
9095
style.Colors[ImGuiCol_HeaderActive] = active;
91-
style.Colors[ImGuiCol_TitleBg] = hovered;
92-
style.Colors[ImGuiCol_TitleBgActive] = active;
93-
style.Colors[ImGuiCol_TitleBgCollapsed] = hovered;
96+
style.Colors[ImGuiCol_TitleBg] = background;
97+
style.Colors[ImGuiCol_TitleBgActive] = background;
98+
style.Colors[ImGuiCol_TitleBgCollapsed] = background;
9499
style.Colors[ImGuiCol_Header] = active;
95100
style.Colors[ImGuiCol_HeaderHovered] = hovered;
96101
style.Colors[ImGuiCol_HeaderActive] = active;

0 commit comments

Comments
 (0)