Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Oct 7, 2024
1 parent fdcf70d commit 9fd6749
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions JL.Windows/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ public static void ApplyPreferences()
using SqliteConnection connection = ConfigDBManager.CreateReadWriteDBConnection();
CoreConfigManager.ApplyPreferences(connection);

SkinType skinType = ConfigDBManager.GetValueFromConfig(connection, Theme, nameof(Theme), Enum.TryParse);
if (skinType != Theme)
SkinType theme = ConfigDBManager.GetValueFromConfig(connection, Theme, nameof(Theme), Enum.TryParse);
if (theme != Theme)
{
Theme = skinType;
Theme = theme;
WindowsUtils.ChangeTheme(Theme);
}

Expand Down Expand Up @@ -938,11 +938,12 @@ public static void LoadPreferenceWindow(PreferencesWindow preferenceWindow)
preferenceWindow.AutoLookupFirstTermWhenTextIsCopiedFromWebSocketCheckBox.IsChecked = AutoLookupFirstTermWhenTextIsCopiedFromWebSocket;
preferenceWindow.AutoLookupFirstTermOnTextChangeOnlyWhenMainWindowIsMinimizedCheckBox.IsChecked = AutoLookupFirstTermOnTextChangeOnlyWhenMainWindowIsMinimized;

preferenceWindow.ThemeComboBox.SelectedValue = Theme;
preferenceWindow.MainWindowTextVerticalAlignmentComboBox.SelectedValue = MainWindowTextVerticalAlignment;

using SqliteConnection connection = ConfigDBManager.CreateReadOnlyDBConnection();
preferenceWindow.ProfileComboBox.ItemsSource = ProfileDBUtils.GetProfileNames(connection);
preferenceWindow.ProfileComboBox.SelectedItem = ProfileUtils.CurrentProfileName;
preferenceWindow.ThemeComboBox.SelectedValue = ConfigDBManager.GetSettingValue(connection, nameof(Theme));
preferenceWindow.MainWindowTextVerticalAlignmentComboBox.SelectedValue = ConfigDBManager.GetSettingValue(connection, nameof(MainWindowTextVerticalAlignment));
preferenceWindow.MinimumLogLevelComboBox.SelectedValue = ConfigDBManager.GetSettingValue(connection, "MinimumLogLevel");
preferenceWindow.PopupPositionRelativeToCursorComboBox.SelectedValue = ConfigDBManager.GetSettingValue(connection, "PopupPositionRelativeToCursor");
preferenceWindow.PopupFlipComboBox.SelectedValue = ConfigDBManager.GetSettingValue(connection, "PopupFlip");
Expand Down

0 comments on commit 9fd6749

Please sign in to comment.