diff --git a/RetroBar/App.config b/RetroBar/App.config deleted file mode 100644 index 2c42d133..00000000 --- a/RetroBar/App.config +++ /dev/null @@ -1,81 +0,0 @@ - - - - -
- - - - - - Windows 95-98 - - - True - - - True - - - True - - - %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar - - - False - - - False - - - System - - - 3 - - - False - - - False - - - False - - - False - - - False - - - 7820ae76-23e3-4229-82c1-e41cb67d5b9c|7820ae75-23e3-4229-82c1-e41cb67d5b9c|7820ae74-23e3-4229-82c1-e41cb67d5b9c|7820ae73-23e3-4229-82c1-e41cb67d5b9c - - - - - - False - - - 0 - - - 1 - - - False - - - False - - - False - - - 0 - - - - \ No newline at end of file diff --git a/RetroBar/Controls/NotifyBalloon.xaml.cs b/RetroBar/Controls/NotifyBalloon.xaml.cs index 689ae144..637e06bf 100644 --- a/RetroBar/Controls/NotifyBalloon.xaml.cs +++ b/RetroBar/Controls/NotifyBalloon.xaml.cs @@ -47,7 +47,7 @@ public CustomPopupPlacement[] PlacePopup(Size popupSize, Size targetSize, Point DpiScale dpiScale = VisualTreeHelper.GetDpi(this); - switch ((AppBarEdge)Settings.Instance.Edge) + switch (Settings.Instance.Edge) { case AppBarEdge.Top: if (FlowDirection == FlowDirection.LeftToRight) diff --git a/RetroBar/Controls/NotifyIcon.xaml.cs b/RetroBar/Controls/NotifyIcon.xaml.cs index 874b7001..e7d6146b 100644 --- a/RetroBar/Controls/NotifyIcon.xaml.cs +++ b/RetroBar/Controls/NotifyIcon.xaml.cs @@ -33,7 +33,7 @@ public NotifyIcon() private void applyEffects() { - if ((!EnvironmentHelper.IsWindows10OrBetter && Settings.Instance.InvertIconsMode == 0) || TrayIcon == null || Settings.Instance.InvertIconsMode == 2) + if ((!EnvironmentHelper.IsWindows10OrBetter && Settings.Instance.InvertIconsMode == Settings.InvertIconsOption.WhenNeededByTheme) || TrayIcon == null || Settings.Instance.InvertIconsMode == Settings.InvertIconsOption.Never) { return; } @@ -53,7 +53,7 @@ private void applyEffects() } bool invertByTheme = Application.Current.FindResource("InvertSystemNotifyIcons") as bool? ?? false; - bool performInvert = invertByTheme || Settings.Instance.InvertIconsMode == 1; + bool performInvert = invertByTheme || Settings.Instance.InvertIconsMode == Settings.InvertIconsOption.Always; if (NotifyIconImage.Effect == null != performInvert) { diff --git a/RetroBar/Controls/TaskList.xaml.cs b/RetroBar/Controls/TaskList.xaml.cs index 6b64eb6f..7c8c9367 100644 --- a/RetroBar/Controls/TaskList.xaml.cs +++ b/RetroBar/Controls/TaskList.xaml.cs @@ -56,7 +56,7 @@ private void SetStyles() MinButtonWidth = Application.Current.FindResource("TaskButtonMinWidth") as double? ?? 0; Thickness buttonMargin; - if (Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right) + if (Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right) { buttonMargin = Application.Current.FindResource("TaskButtonVerticalMargin") as Thickness? ?? new Thickness(); } @@ -98,7 +98,7 @@ private void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e) } else if (e.PropertyName == "ShowMultiMon") { - if (Settings.Instance.MultiMonMode != 0) + if (Settings.Instance.MultiMonMode != Settings.MultiMonOption.AllTaskbars) { taskbarItems?.Refresh(); } @@ -114,12 +114,12 @@ private bool Tasks_Filter(object obj) return false; } - if (!Settings.Instance.ShowMultiMon || Settings.Instance.MultiMonMode == 0) + if (!Settings.Instance.ShowMultiMon || Settings.Instance.MultiMonMode == Settings.MultiMonOption.AllTaskbars) { return true; } - if (Settings.Instance.MultiMonMode == 2 && Host.Screen.Primary) + if (Settings.Instance.MultiMonMode == Settings.MultiMonOption.SameAsWindowAndPrimary && Host.Screen.Primary) { return true; } @@ -159,7 +159,7 @@ private void TaskList_OnSizeChanged(object sender, SizeChangedEventArgs e) private void SetTaskButtonWidth() { - if (Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right) + if (Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right) { ButtonWidth = ActualWidth; SetScrollable(true); // while technically not always scrollable, we don't run into DPI-specific issues with it enabled while vertical diff --git a/RetroBar/Converters/DockOrientationConverter.cs b/RetroBar/Converters/DockOrientationConverter.cs index c7af5a30..9f8861e7 100644 --- a/RetroBar/Converters/DockOrientationConverter.cs +++ b/RetroBar/Converters/DockOrientationConverter.cs @@ -11,7 +11,7 @@ public class DockOrientationConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { - bool vertical = Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right; + bool vertical = Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right; // parameter is a string "leading" or "trailing" diff --git a/RetroBar/Converters/EdgeOrientationConverter.cs b/RetroBar/Converters/EdgeOrientationConverter.cs index 7f8000e0..1f266e78 100644 --- a/RetroBar/Converters/EdgeOrientationConverter.cs +++ b/RetroBar/Converters/EdgeOrientationConverter.cs @@ -11,7 +11,7 @@ public class EdgeOrientationConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { - if (Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right) + if (Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right) { return Orientation.Vertical; } diff --git a/RetroBar/Converters/EnumConverter.cs b/RetroBar/Converters/EnumConverter.cs new file mode 100644 index 00000000..a1a2ebda --- /dev/null +++ b/RetroBar/Converters/EnumConverter.cs @@ -0,0 +1,19 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace RetroBar.Converters +{ + public class EnumConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return (int)value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return Enum.ToObject(targetType, value); + } + } +} diff --git a/RetroBar/Converters/ToolTipHorizontalOffsetConverter.cs b/RetroBar/Converters/ToolTipHorizontalOffsetConverter.cs index 2c6e29e6..2dc7a777 100644 --- a/RetroBar/Converters/ToolTipHorizontalOffsetConverter.cs +++ b/RetroBar/Converters/ToolTipHorizontalOffsetConverter.cs @@ -18,7 +18,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur return double.NaN; } - if (Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right) + if (Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right) { return (double)0; } diff --git a/RetroBar/Converters/ToolTipPlacementConverter.cs b/RetroBar/Converters/ToolTipPlacementConverter.cs index c3c3cc67..c50618a3 100644 --- a/RetroBar/Converters/ToolTipPlacementConverter.cs +++ b/RetroBar/Converters/ToolTipPlacementConverter.cs @@ -11,15 +11,15 @@ public class ToolTipPlacementConverter : IMultiValueConverter { public object Convert(object[] value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { - if (Settings.Instance.Edge == (int)AppBarEdge.Left) + if (Settings.Instance.Edge == AppBarEdge.Left) { return PlacementMode.Right; } - else if (Settings.Instance.Edge == (int)AppBarEdge.Right) + else if (Settings.Instance.Edge == AppBarEdge.Right) { return PlacementMode.Left; } - else if (Settings.Instance.Edge == (int)AppBarEdge.Top) + else if (Settings.Instance.Edge == AppBarEdge.Top) { return PlacementMode.Bottom; } diff --git a/RetroBar/Converters/ToolTipVerticalOffsetConverter.cs b/RetroBar/Converters/ToolTipVerticalOffsetConverter.cs index cebe5f15..ad72b36c 100644 --- a/RetroBar/Converters/ToolTipVerticalOffsetConverter.cs +++ b/RetroBar/Converters/ToolTipVerticalOffsetConverter.cs @@ -18,7 +18,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur return double.NaN; } - if (Settings.Instance.Edge == (int)AppBarEdge.Left || Settings.Instance.Edge == (int)AppBarEdge.Right) + if (Settings.Instance.Edge == AppBarEdge.Left || Settings.Instance.Edge == AppBarEdge.Right) { double placementTargetHeight = (double)values[0]; double toolTipHeight = (double)values[1]; diff --git a/RetroBar/Properties/Settings.Designer.cs b/RetroBar/Properties/Settings.Designer.cs deleted file mode 100644 index 7efd6821..00000000 --- a/RetroBar/Properties/Settings.Designer.cs +++ /dev/null @@ -1,303 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace RetroBar.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("Windows 95-98")] - public string Theme { - get { - return ((string)(this["Theme"])); - } - set { - this["Theme"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool IsFirstRun { - get { - return ((bool)(this["IsFirstRun"])); - } - set { - this["IsFirstRun"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool ShowClock { - get { - return ((bool)(this["ShowClock"])); - } - set { - this["ShowClock"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool ShowQuickLaunch { - get { - return ((bool)(this["ShowQuickLaunch"])); - } - set { - this["ShowQuickLaunch"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("%appdata%\\Microsoft\\Internet Explorer\\Quick Launch\\User Pinned\\TaskBar")] - public string QuickLaunchPath { - get { - return ((string)(this["QuickLaunchPath"])); - } - set { - this["QuickLaunchPath"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool CollapseNotifyIcons { - get { - return ((bool)(this["CollapseNotifyIcons"])); - } - set { - this["CollapseNotifyIcons"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool AllowFontSmoothing { - get { - return ((bool)(this["AllowFontSmoothing"])); - } - set { - this["AllowFontSmoothing"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("System")] - public string Language { - get { - return ((string)(this["Language"])); - } - set { - this["Language"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("3")] - public int Edge { - get { - return ((int)(this["Edge"])); - } - set { - this["Edge"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ShowMultiMon { - get { - return ((bool)(this["ShowMultiMon"])); - } - set { - this["ShowMultiMon"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool UseSoftwareRendering { - get { - return ((bool)(this["UseSoftwareRendering"])); - } - set { - this["UseSoftwareRendering"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool MiddleMouseToClose { - get { - return ((bool)(this["MiddleMouseToClose"])); - } - set { - this["MiddleMouseToClose"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ShowDesktopButton { - get { - return ((bool)(this["ShowDesktopButton"])); - } - set { - this["ShowDesktopButton"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool PeekAtDesktop { - get { - return ((bool)(this["PeekAtDesktop"])); - } - set { - this["PeekAtDesktop"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("7820ae76-23e3-4229-82c1-e41cb67d5b9c|7820ae75-23e3-4229-82c1-e41cb67d5b9c|7820ae7" + - "4-23e3-4229-82c1-e41cb67d5b9c|7820ae73-23e3-4229-82c1-e41cb67d5b9c")] - public string PinnedNotifyIcons { - get { - return ((string)(this["PinnedNotifyIcons"])); - } - set { - this["PinnedNotifyIcons"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] - public string QuickLaunchOrder { - get { - return ((string)(this["QuickLaunchOrder"])); - } - set { - this["QuickLaunchOrder"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool ShowTaskThumbnails { - get { - return ((bool)(this["ShowTaskThumbnails"])); - } - set { - this["ShowTaskThumbnails"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int MultiMonMode { - get { - return ((int)(this["MultiMonMode"])); - } - set { - this["MultiMonMode"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("1")] - public double TaskbarScale { - get { - return ((double)(this["TaskbarScale"])); - } - set { - this["TaskbarScale"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool DebugLogging { - get { - return ((bool)(this["DebugLogging"])); - } - set { - this["DebugLogging"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool AutoHide { - get { - return ((bool)(this["AutoHide"])); - } - set { - this["AutoHide"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool LockTaskbar { - get { - return ((bool)(this["LockTaskbar"])); - } - set { - this["LockTaskbar"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] - public int InvertIconsMode { - get { - return ((int)(this["InvertIconsMode"])); - } - set { - this["InvertIconsMode"] = value; - } - } - } -} diff --git a/RetroBar/Properties/Settings.settings b/RetroBar/Properties/Settings.settings deleted file mode 100644 index 3be62365..00000000 --- a/RetroBar/Properties/Settings.settings +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - Windows 95-98 - - - True - - - True - - - True - - - %appdata%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar - - - False - - - False - - - System - - - 3 - - - False - - - False - - - False - - - False - - - False - - - 7820ae76-23e3-4229-82c1-e41cb67d5b9c|7820ae75-23e3-4229-82c1-e41cb67d5b9c|7820ae74-23e3-4229-82c1-e41cb67d5b9c|7820ae73-23e3-4229-82c1-e41cb67d5b9c - - - - - - False - - - 0 - - - 1 - - - False - - - False - - - False - - - 0 - - - \ No newline at end of file diff --git a/RetroBar/PropertiesWindow.xaml b/RetroBar/PropertiesWindow.xaml index c879df57..c98b59a8 100644 --- a/RetroBar/PropertiesWindow.xaml +++ b/RetroBar/PropertiesWindow.xaml @@ -22,6 +22,7 @@ +