diff --git a/Controls/GimbalControlSettingsForm.cs b/Controls/GimbalControlSettingsForm.cs index eee199f85e..68181064a0 100644 --- a/Controls/GimbalControlSettingsForm.cs +++ b/Controls/GimbalControlSettingsForm.cs @@ -20,11 +20,10 @@ public GimbalControlSettingsForm(GimbalControlSettings preferences) { InitializeComponent(); - ThemeManager.ApplyThemeTo(this); - this.preferences = new GimbalControlSettings(preferences); - LoadPreferences(); + + ThemeManager.ApplyThemeTo(this); } private void LoadPreferences() diff --git a/Utilities/ThemeManager.cs b/Utilities/ThemeManager.cs index 42bd2d1a03..a231550489 100644 --- a/Utilities/ThemeManager.cs +++ b/Utilities/ThemeManager.cs @@ -1147,9 +1147,8 @@ private static void ApplyTheme(Control temp, int level) ctl.ForeColor = Color.Black; ctl.BackColor = ButBG; } - else if (ctl.GetType() == typeof(MyButton)) + else if (ctl is MyButton but) { - Controls.MyButton but = (MyButton)ctl; but.BGGradTop = ButBG; but.BGGradBot = ButBGBot; but.TextColor = ButtonTextColor;