mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Fix General tab being unselected on language change
This commit is contained in:
parent
950c69330b
commit
0e72153bae
1 changed files with 5 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ internal sealed class SettingsWindow : Window
|
|||
private string searchInput = string.Empty;
|
||||
private bool isSearchInputPrefilled = false;
|
||||
|
||||
private SettingsTab setActiveTab = null!;
|
||||
private SettingsTab? setActiveTab;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SettingsWindow"/> class.
|
||||
|
|
@ -53,6 +53,8 @@ internal sealed class SettingsWindow : Window
|
|||
|
||||
private static string Title => Loc.Localize("DalamudSettingsHeader", "Dalamud Settings") + "###XlSettings2";
|
||||
|
||||
private SettingsTab? CurrentlyOpenTab => this.tabs.FirstOrDefault(tab => tab.IsOpen);
|
||||
|
||||
/// <summary>
|
||||
/// Open the settings window to the tab specified by <paramref name="kind"/>.
|
||||
/// </summary>
|
||||
|
|
@ -150,7 +152,7 @@ internal sealed class SettingsWindow : Window
|
|||
public override void Draw()
|
||||
{
|
||||
ImGui.SetNextItemWidth(-1);
|
||||
using (ImRaii.Disabled(this.tabs.OfType<SettingsTabAbout>().Single().IsOpen))
|
||||
using (ImRaii.Disabled(this.CurrentlyOpenTab is SettingsTabAbout))
|
||||
ImGui.InputTextWithHint("###searchInput"u8, Loc.Localize("DalamudSettingsSearchPlaceholder", "Search for settings..."), ref this.searchInput, 100, ImGuiInputTextFlags.AutoSelectAll);
|
||||
ImGui.Spacing();
|
||||
|
||||
|
|
@ -326,5 +328,6 @@ internal sealed class SettingsWindow : Window
|
|||
private void OnLocalizationChanged(string langCode)
|
||||
{
|
||||
this.WindowName = Title;
|
||||
this.setActiveTab = this.CurrentlyOpenTab;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue