From db8751a4270009c62df6bf50134325d630dd12d8 Mon Sep 17 00:00:00 2001 From: stuhl Date: Fri, 24 Sep 2021 18:15:57 +0200 Subject: [PATCH 1/9] add switch to set desktop hdr mode --- Source/HDRProfile/UserAppSettings.cs | 5 ++++- Source/HDRProfile/Views/UserAppSettingsView.xaml | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/HDRProfile/UserAppSettings.cs b/Source/HDRProfile/UserAppSettings.cs index c3abc39..12d81fc 100644 --- a/Source/HDRProfile/UserAppSettings.cs +++ b/Source/HDRProfile/UserAppSettings.cs @@ -24,6 +24,7 @@ public class UserAppSettings : BaseViewModel private bool _closeToTray; private bool _checkForNewVersion = true; private HDRActivationMode _hdrMode; + private OnOff _desktopHDRDefault = OnOff.OFF; readonly object _audioDevicesLock = new object(); private ObservableCollection _applicationItems; private ObservableCollection _monitors; @@ -51,7 +52,8 @@ public class UserAppSettings : BaseViewModel [DataMember] public HDRActivationMode HDRMode { get => _hdrMode; set { _hdrMode = value; OnPropertyChanged(); } } - + [DataMember] + public OnOff DesktopHDRDefault { get => _desktopHDRDefault; set { _desktopHDRDefault = value; OnPropertyChanged(); } } [DataMember] public ObservableCollection ApplicationItems { get => _applicationItems; set {_applicationItems = value; OnPropertyChanged();} } @@ -87,6 +89,7 @@ public static UserAppSettings Convert(HDRProfileSettings settings) convertedSettings.CloseToTray = settings.CloseToTray; convertedSettings.GlobalAutoHDR = settings.GlobalAutoHDR; convertedSettings.HDRMode = settings.HDRMode; + convertedSettings.DesktopHDRDefault = settings.DesktopHDRDefault; convertedSettings.Logging = settings.Logging; convertedSettings.Monitors = settings.Monitors; convertedSettings.StartMinimizedToTray = settings.StartMinimizedToTray; diff --git a/Source/HDRProfile/Views/UserAppSettingsView.xaml b/Source/HDRProfile/Views/UserAppSettingsView.xaml index 8e4e41f..bdca999 100644 --- a/Source/HDRProfile/Views/UserAppSettingsView.xaml +++ b/Source/HDRProfile/Views/UserAppSettingsView.xaml @@ -23,6 +23,13 @@ + + + + + @@ -49,7 +56,7 @@ - + @@ -58,6 +65,7 @@ + From 4270e983db825806a466379cd7d0c8d8ee0ca86e Mon Sep 17 00:00:00 2001 From: stuhl Date: Fri, 24 Sep 2021 18:18:55 +0200 Subject: [PATCH 2/9] add preventHDR Application Property --- Source/HDRProfile/ApplicationItem.cs | 3 +++ Source/HDRProfile/Views/AutoHDRMainView.xaml | 26 ++++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Source/HDRProfile/ApplicationItem.cs b/Source/HDRProfile/ApplicationItem.cs index c95ecb9..df30533 100644 --- a/Source/HDRProfile/ApplicationItem.cs +++ b/Source/HDRProfile/ApplicationItem.cs @@ -18,7 +18,9 @@ public class ApplicationItem : BaseViewModel, IEquatable private string _applicationFilePath; private string _applicationName; private System.Drawing.Bitmap icon = null; + /// compatibility checkbox in mainView private bool _restartProcess = false; + private bool _preventHdr = false; private string _uwpFamilyPackageName; private string _uwpApplicationID; private string _uwpIconPath; @@ -28,6 +30,7 @@ public class ApplicationItem : BaseViewModel, IEquatable public string ApplicationName { get => _applicationName; set { _applicationName = value; OnPropertyChanged(); } } public string ApplicationFilePath { get => _applicationFilePath; set { _applicationFilePath = value; try { Icon = Tools.GetFileIcon(value); } catch { } OnPropertyChanged(); } } public bool RestartProcess { get => _restartProcess; set { _restartProcess = value; OnPropertyChanged(); } } + public bool PreventHdr { get => _preventHdr; set { _preventHdr = value; OnPropertyChanged(); } } public bool IsUWP { get => _isUWP; set { _isUWP = value; OnPropertyChanged(); } } [XmlIgnore] diff --git a/Source/HDRProfile/Views/AutoHDRMainView.xaml b/Source/HDRProfile/Views/AutoHDRMainView.xaml index bdbddc2..da67860 100644 --- a/Source/HDRProfile/Views/AutoHDRMainView.xaml +++ b/Source/HDRProfile/Views/AutoHDRMainView.xaml @@ -38,13 +38,16 @@ - - + + + - - - + + + + + @@ -87,7 +90,7 @@ - +