Just null check the styles

This commit is contained in:
Infi
2024-04-12 22:11:17 +02:00
parent 4751e3c8f7
commit c66d97829c
12 changed files with 60 additions and 60 deletions
+1
View File
@@ -87,6 +87,7 @@ internal sealed class About : ISettingsTab {
ImGui.EndChild();
}
ImGui.Spacing();
ImGui.PopTextWrapPos();
}
}
+2
View File
@@ -60,5 +60,7 @@ internal sealed class ChatColours : ISettingsTab {
}
}
}
ImGui.Spacing();
}
}
+2
View File
@@ -126,5 +126,7 @@ internal sealed class Database : ISettingsTab
ImGui.PopTextWrapPos();
ImGui.TreePop();
}
ImGui.Spacing();
}
}
+16 -9
View File
@@ -101,19 +101,26 @@ internal sealed class Display : ISettingsTab {
if (Mutable.OverrideStyle)
{
var currentStyle = Mutable.ChosenStyle.Equals("") ? StyleModel.GetConfiguredStyle().Name : Mutable.ChosenStyle;
if (ImGui.BeginCombo(Language.Options_OverrideStyleDropdown_Name, currentStyle)) {
foreach (var style in StyleModel.GetConfiguredStyles()) {
if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name)) {
Mutable.ChosenStyle = style.Name;
}
}
var styles = StyleModel.GetConfiguredStyles();
if (styles != null)
{
var currentStyle = Mutable.ChosenStyle ?? Language.Options_OverrideStyle_NotSelected;
if (ImGui.BeginCombo(Language.Options_OverrideStyleDropdown_Name, currentStyle))
{
foreach (var style in styles)
if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name))
Mutable.ChosenStyle = style.Name;
ImGui.EndCombo();
ImGui.EndCombo();
}
}
else
{
ImGui.TextUnformatted(Language.Options_OverrideStyle_NotAvailable);
}
}
ImGui.Spacing();
ImGui.Spacing();
ImGui.PopTextWrapPos();
}
}
+1
View File
@@ -113,6 +113,7 @@ public class Fonts : ISettingsTab {
ImGuiUtil.DragFloatVertical(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSize, speed, min, max, $"{Mutable.SymbolsFontSize:N1}");
ImGuiUtil.HelpText(Language.Options_SymbolsFontSize_Description);
ImGui.Spacing();
ImGui.PopTextWrapPos();
}
}
+1
View File
@@ -61,6 +61,7 @@ internal sealed class Miscellaneous : ISettingsTab {
ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref Mutable.SortAutoTranslate);
ImGuiUtil.HelpText(Language.Options_SortAutoTranslate_Description);
ImGui.Spacing();
}
}