Move Reset Button

This commit is contained in:
TheBrokenRail 2024-11-21 04:07:50 -05:00
parent ed59e19c52
commit 70ef421780
2 changed files with 10 additions and 6 deletions

View File

@ -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)) { if (ImGui::BeginChild("General", ImVec2(0, -ImGui::GetFrameHeightWithSpacing() /* Leave Room For One Line */), ImGuiChildFlags_None, ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse)) {
// Tabs // Tabs
if (ImGui::BeginTabBar("tab_bar", ImGuiTabBarFlags_None)) { if (ImGui::BeginTabBar("tab_bar", ImGuiTabBarFlags_None)) {
if (ImGui::BeginTabItem("Main", nullptr, ImGuiTabItemFlags_None)) { if (ImGui::BeginTabItem("General", nullptr, ImGuiTabItemFlags_None)) {
// Main Tab // Main Tab
draw_main(); draw_main();
ImGui::EndTabItem(); ImGui::EndTabItem();
@ -48,6 +48,11 @@ int ConfigurationUI::render() {
} }
ImGui::EndChild(); ImGui::EndChild();
// Bottom Row // Bottom Row
if (ImGui::Button("Reset To Defaults")) {
state = State(empty_cache);
}
ImGui::SameLine();
// Right-Align Buttons
const char *bottom_row_text[] = {"Quit", "Launch"}; const char *bottom_row_text[] = {"Quit", "Launch"};
float width_needed = 0; float width_needed = 0;
for (const char *text : bottom_row_text) { for (const char *text : bottom_row_text) {
@ -99,10 +104,6 @@ void ConfigurationUI::draw_advanced() const {
draw_category(category); draw_category(category);
} }
} }
ImGui::Spacing();
if (ImGui::Button("Reset All Settings")) {
state = State(empty_cache);
}
} }
ImGui::EndChild(); ImGui::EndChild();
} }

View File

@ -86,7 +86,7 @@ void Frame::setup_style(const float scale) {
style.WindowBorderSize = 0; style.WindowBorderSize = 0;
ImGui::StyleColorsDark(&style); ImGui::StyleColorsDark(&style);
style.ScaleAllSizes(scale); style.ScaleAllSizes(scale);
// Colors // Blend Colors
static int target_colors[] = { static int target_colors[] = {
ImGuiCol_FrameBg, ImGuiCol_FrameBg,
ImGuiCol_FrameBgHovered, ImGuiCol_FrameBgHovered,
@ -121,4 +121,7 @@ void Frame::setup_style(const float scale) {
ImVec4 &color = style.Colors[target_color]; ImVec4 &color = style.Colors[target_color];
color = blend_with_primary(color); color = blend_with_primary(color);
} }
// Update Border Color
ImVec4 &border_color = style.Colors[ImGuiCol_Border];
border_color.z = border_color.x;
} }