From 70ef421780aa63117bfff86fa3f76ca95120c7c8 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Thu, 21 Nov 2024 04:07:50 -0500 Subject: [PATCH] Move Reset Button --- launcher/src/client/ui.cpp | 11 ++++++----- launcher/src/ui/frame.cpp | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/launcher/src/client/ui.cpp b/launcher/src/client/ui.cpp index 2735d69e11..7cc6e42527 100644 --- a/launcher/src/client/ui.cpp +++ b/launcher/src/client/ui.cpp @@ -33,7 +33,7 @@ int ConfigurationUI::render() { if (ImGui::BeginChild("General", ImVec2(0, -ImGui::GetFrameHeightWithSpacing() /* Leave Room For One Line */), ImGuiChildFlags_None, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) { // Tabs if (ImGui::BeginTabBar("tab_bar", ImGuiTabBarFlags_None)) { - if (ImGui::BeginTabItem("Main", nullptr, ImGuiTabItemFlags_None)) { + if (ImGui::BeginTabItem("General", nullptr, ImGuiTabItemFlags_None)) { // Main Tab draw_main(); ImGui::EndTabItem(); @@ -48,6 +48,11 @@ int ConfigurationUI::render() { } ImGui::EndChild(); // Bottom Row + if (ImGui::Button("Reset To Defaults")) { + state = State(empty_cache); + } + ImGui::SameLine(); + // Right-Align Buttons const char *bottom_row_text[] = {"Quit", "Launch"}; float width_needed = 0; for (const char *text : bottom_row_text) { @@ -99,10 +104,6 @@ void ConfigurationUI::draw_advanced() const { draw_category(category); } } - ImGui::Spacing(); - if (ImGui::Button("Reset All Settings")) { - state = State(empty_cache); - } } ImGui::EndChild(); } diff --git a/launcher/src/ui/frame.cpp b/launcher/src/ui/frame.cpp index 8fa4397f1c..352cb13c70 100644 --- a/launcher/src/ui/frame.cpp +++ b/launcher/src/ui/frame.cpp @@ -86,7 +86,7 @@ void Frame::setup_style(const float scale) { style.WindowBorderSize = 0; ImGui::StyleColorsDark(&style); style.ScaleAllSizes(scale); - // Colors + // Blend Colors static int target_colors[] = { ImGuiCol_FrameBg, ImGuiCol_FrameBgHovered, @@ -121,4 +121,7 @@ void Frame::setup_style(const float scale) { ImVec4 &color = style.Colors[target_color]; color = blend_with_primary(color); } + // Update Border Color + ImVec4 &border_color = style.Colors[ImGuiCol_Border]; + border_color.z = border_color.x; }