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)) {
// 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();
}

View File

@ -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;
}