Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use red Ban button for invalid settings #15

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions src/XIVLauncher.Core/Components/SettingsPage/SettingsPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,25 @@ public override void Draw()

var invalid = this.tabs.Any(x => x.Entries.Any(y => !y.IsValid));
if (invalid)
{
ImGui.BeginDisabled();

if (ImGui.Button(FontAwesomeIcon.Check.ToIconString(), new Vector2(40)))
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.Button(FontAwesomeIcon.Ban.ToIconString(), new Vector2(40));
ImGui.PopStyleColor();
ImGui.EndDisabled();
}
else
{
foreach (var settingsTab in this.tabs)
if (ImGui.Button(FontAwesomeIcon.Check.ToIconString(), new Vector2(40)))
{
settingsTab.Save();
}
foreach (var settingsTab in this.tabs)
{
settingsTab.Save();
}

this.App.State = LauncherApp.LauncherState.Main;
this.App.State = LauncherApp.LauncherState.Main;
}
}

if (invalid)
ImGui.EndDisabled();
}

ImGui.EndChild();
Expand Down