diff --git a/Source/Installer/Product.wxs b/Source/Installer/Product.wxs index dc02f901..34378a8f 100644 --- a/Source/Installer/Product.wxs +++ b/Source/Installer/Product.wxs @@ -1,6 +1,6 @@  - + /// Whether to use accent color for brightness + /// + [DataMember] + public bool UsesAccentColor + { + get => _usesAccentColor; + set => SetPropertyValue(ref _usesAccentColor, value); + } + private bool _usesAccentColor; + /// /// Whether to show adjusted brightness /// diff --git a/Source/Monitorian.Core/Models/Watcher/BrightnessWatcher.cs b/Source/Monitorian.Core/Models/Watcher/BrightnessWatcher.cs index d4e49a79..3aded9d0 100644 --- a/Source/Monitorian.Core/Models/Watcher/BrightnessWatcher.cs +++ b/Source/Monitorian.Core/Models/Watcher/BrightnessWatcher.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Management; +using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; @@ -68,11 +69,11 @@ protected virtual void Dispose(bool disposing) if (_watcher is not null) { _watcher.EventArrived -= OnEventArrived; - _watcher.Stop(); // This may throw InvalidCastException. + _watcher.Stop(); // This may throw InvalidCastException or COMException. _watcher.Dispose(); } } - catch (InvalidCastException) + catch (Exception ex) when (ex is InvalidCastException or COMException) { } } diff --git a/Source/Monitorian.Core/Properties/AssemblyInfo.cs b/Source/Monitorian.Core/Properties/AssemblyInfo.cs index 9431be9c..5fc2dbaf 100644 --- a/Source/Monitorian.Core/Properties/AssemblyInfo.cs +++ b/Source/Monitorian.Core/Properties/AssemblyInfo.cs @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.10.1.0")] -[assembly: AssemblyFileVersion("3.10.1.0")] +[assembly: AssemblyVersion("3.11.0.0")] +[assembly: AssemblyFileVersion("3.11.0.0")] [assembly: NeutralResourcesLanguage("en-US")] // For unit test diff --git a/Source/Monitorian.Core/Properties/Resources.Designer.cs b/Source/Monitorian.Core/Properties/Resources.Designer.cs index 224ea2bc..96046605 100644 --- a/Source/Monitorian.Core/Properties/Resources.Designer.cs +++ b/Source/Monitorian.Core/Properties/Resources.Designer.cs @@ -222,6 +222,15 @@ public static string Rescan { } } + /// + /// Looks up a localized string similar to Restore brightness on reconnection. + /// + public static string RestoreReconnection { + get { + return ResourceManager.GetString("RestoreReconnection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Settings. /// @@ -285,6 +294,15 @@ public static string StatusReasonDdcNotEnabled { } } + /// + /// Looks up a localized string similar to Use accent color for brightness. + /// + public static string UseAccentColor { + get { + return ResourceManager.GetString("UseAccentColor", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use large sliders. /// diff --git a/Source/Monitorian.Core/Properties/Resources.ja-JP.resx b/Source/Monitorian.Core/Properties/Resources.ja-JP.resx index 69654052..f32702c8 100644 --- a/Source/Monitorian.Core/Properties/Resources.ja-JP.resx +++ b/Source/Monitorian.Core/Properties/Resources.ja-JP.resx @@ -171,6 +171,9 @@ モニターを再探索する + + 再接続時に明るさを復元する + 設定 @@ -192,6 +195,9 @@ DDC/CIがサポートされていないか有効になっていません。 + + 明るさにアクセントカラーを使う + 大きいスライダーを使う diff --git a/Source/Monitorian.Core/Properties/Resources.resx b/Source/Monitorian.Core/Properties/Resources.resx index 577beea6..f4ecff1e 100644 --- a/Source/Monitorian.Core/Properties/Resources.resx +++ b/Source/Monitorian.Core/Properties/Resources.resx @@ -171,6 +171,9 @@ Rescan monitors + + Restore brightness on reconnection + Settings @@ -192,6 +195,9 @@ DDC/CI is not supported or enabled. + + Use accent color for brightness + Use large sliders diff --git a/Source/Monitorian.Core/Views/Generic.xaml b/Source/Monitorian.Core/Views/Generic.xaml index 4657f12e..4e5553f6 100644 --- a/Source/Monitorian.Core/Views/Generic.xaml +++ b/Source/Monitorian.Core/Views/Generic.xaml @@ -10,6 +10,10 @@ LightGray #48000000 + #FF2982CC + #FF5CA4DE + #FF5CA4DE + @@ -18,7 +22,6 @@ - #FF808080 #33FFFFFF diff --git a/Source/Monitorian.Core/Views/MainWindow.xaml b/Source/Monitorian.Core/Views/MainWindow.xaml index 948e5247..8385c7e2 100644 --- a/Source/Monitorian.Core/Views/MainWindow.xaml +++ b/Source/Monitorian.Core/Views/MainWindow.xaml @@ -39,9 +39,6 @@