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/AutoHDRDaemon.cs b/Source/HDRProfile/AutoHDRDaemon.cs index 8bf13d0..97e15da 100644 --- a/Source/HDRProfile/AutoHDRDaemon.cs +++ b/Source/HDRProfile/AutoHDRDaemon.cs @@ -81,7 +81,13 @@ public Version Version return Tools.ApplicationVersion; } } - + /// + /// Returns true if a Application with preventHDR Option is running or focused + /// + public bool IsHDRAllowedToActivate() + { + return !ProcessWatcher.Applications.Any(e => (e.Value == ApplicationState.Running || e.Value == ApplicationState.Focused) && e.Key.PreventHdr == true); + } public AutoHDRDaemon() { @@ -324,7 +330,12 @@ private void StartApplication(ApplicationItem application) } catch (Exception ex) { - Tools.Logs.AddException(ex); + try + { + //can throw an error + Tools.Logs.AddException(ex); + } + catch { } } } @@ -466,35 +477,70 @@ private void ProcessWatcher_RunningOrFocusedChanged(object sender, EventArgs e) UpdateHDRModeBasedOnCurrentApplication(); } - + /// + /// Converts OnOff Enum to boolean + /// + /// + /// + private bool OnOffToBool(OnOff OnOff) + { + switch (OnOff){ + case OnOff + .ON: return true; + default: return false; + } + } private void UpdateHDRModeBasedOnCurrentApplication() { lock (_accessLock) { - try - { - bool activateHDR = false; + try { + + //check if any running process is preventing HDR + bool allowedHDR = IsHDRAllowedToActivate(); + + //check running processes wants to activate HDR + bool processRequestHDR = false; switch (Settings.HDRMode) { case HDRActivationMode.Running: - activateHDR = ProcessWatcher.OneProcessIsRunning; + processRequestHDR = ProcessWatcher.OneProcessIsRunning; break; case HDRActivationMode.Focused: - activateHDR = ProcessWatcher.OneProcessIsFocused; + processRequestHDR = ProcessWatcher.OneProcessIsFocused; break; default: return; - + } + bool activateHDR = false; + if (allowedHDR) + { + if (OnOffToBool(Settings.DesktopHDRDefault)) + { + //HDR is always active on allowedHDR and desktopIsHdr + activateHDR = true; + } + else + { + //Desktop is not HDR so we need to check if a process request it + activateHDR = processRequestHDR; + } } + + //hdr is already active if (activateHDR == HDRIsActive) + { return; + } + //hdr hast to be activated if (activateHDR) { Tools.Logs.Add($"Activating HDR...", false); MonitorManager.ActivateHDR(); } + //hdr has to be deactivated else if (DisplayManager.GlobalHDRIsActive && Settings.HDRMode != HDRActivationMode.None) { Tools.Logs.Add($"Deactivating HDR...", false); diff --git a/Source/HDRProfile/HDRProfileSettings.cs b/Source/HDRProfile/HDRProfileSettings.cs index 2784b6d..30eaf0c 100644 --- a/Source/HDRProfile/HDRProfileSettings.cs +++ b/Source/HDRProfile/HDRProfileSettings.cs @@ -25,6 +25,7 @@ public class HDRProfileSettings : BaseViewModel private bool _closeToTray; private bool _checkForNewVersion = true; private HDRActivationMode _hdrMode; + private OnOff _desktopHDRDefault; readonly object _audioDevicesLock = new object(); private ObservableCollection _applicationItems; private ObservableCollection _monitors; @@ -46,13 +47,15 @@ public class HDRProfileSettings : BaseViewModel [DataMember] public bool CloseToTray { get => _closeToTray; set { _closeToTray = value; OnPropertyChanged(); } } - [DataMember] public bool CheckForNewVersion { get => _checkForNewVersion; set { _checkForNewVersion = value; OnPropertyChanged(); } } [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();} } diff --git a/Source/HDRProfile/ProjectResources/Locale_Enums.Designer.cs b/Source/HDRProfile/ProjectResources/Locale_Enums.Designer.cs index 06b9eac..c2c984f 100644 --- a/Source/HDRProfile/ProjectResources/Locale_Enums.Designer.cs +++ b/Source/HDRProfile/ProjectResources/Locale_Enums.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace AutoHDR.ProjectResources { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Locale_Enums() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Locale_Enums() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Locale_Enums() { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Focused ähnelt. + /// Looks up a localized string similar to Focused. /// public static string HDRMode_Focused { get { @@ -70,7 +70,7 @@ public static string HDRMode_Focused { } /// - /// Sucht eine lokalisierte Zeichenfolge, die None ähnelt. + /// Looks up a localized string similar to None. /// public static string HDRMode_None { get { @@ -79,12 +79,30 @@ public static string HDRMode_None { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Runing ähnelt. + /// Looks up a localized string similar to Runing. /// public static string HDRMode_Running { get { return ResourceManager.GetString("HDRMode.Running", resourceCulture); } } + + /// + /// Looks up a localized string similar to Off. + /// + public static string OnOff_OFF { + get { + return ResourceManager.GetString("OnOff.OFF", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to On. + /// + public static string OnOff_ON { + get { + return ResourceManager.GetString("OnOff.ON", resourceCulture); + } + } } } diff --git a/Source/HDRProfile/ProjectResources/Locale_Enums.resx b/Source/HDRProfile/ProjectResources/Locale_Enums.resx index 5aaf890..453479f 100644 --- a/Source/HDRProfile/ProjectResources/Locale_Enums.resx +++ b/Source/HDRProfile/ProjectResources/Locale_Enums.resx @@ -126,4 +126,10 @@ Runing + + Off + + + On + \ No newline at end of file diff --git a/Source/HDRProfile/ProjectResources/Locale_Texts.Designer.cs b/Source/HDRProfile/ProjectResources/Locale_Texts.Designer.cs index e87d0ba..bacbfb0 100644 --- a/Source/HDRProfile/ProjectResources/Locale_Texts.Designer.cs +++ b/Source/HDRProfile/ProjectResources/Locale_Texts.Designer.cs @@ -1,10 +1,10 @@ //------------------------------------------------------------------------------ // -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -13,12 +13,12 @@ namespace AutoHDR.ProjectResources { /// - /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert - // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. - // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen - // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] @@ -33,7 +33,7 @@ internal Locale_Texts() { } /// - /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Resources.ResourceManager ResourceManager { @@ -47,8 +47,8 @@ internal Locale_Texts() { } /// - /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle - /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] public static global::System.Globalization.CultureInfo Culture { @@ -61,7 +61,7 @@ internal Locale_Texts() { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Activate HDR ähnelt. + /// Looks up a localized string similar to Activate HDR. /// public static string ActivateHDR { get { @@ -70,7 +70,7 @@ public static string ActivateHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Add application ähnelt. + /// Looks up a localized string similar to Add application. /// public static string AddApplication { get { @@ -79,7 +79,7 @@ public static string AddApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die AutoHDR is already running. ähnelt. + /// Looks up a localized string similar to AutoHDR is already running.. /// public static string AlreadyRunning { get { @@ -88,7 +88,7 @@ public static string AlreadyRunning { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Application name ähnelt. + /// Looks up a localized string similar to Application name. /// public static string ApplicationName { get { @@ -97,7 +97,7 @@ public static string ApplicationName { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Applications ähnelt. + /// Looks up a localized string similar to Applications. /// public static string Applications { get { @@ -106,7 +106,7 @@ public static string Applications { } /// - /// Sucht eine lokalisierte Zeichenfolge, die AutoHDR ähnelt. + /// Looks up a localized string similar to AutoHDR. /// public static string AutoHDR { get { @@ -115,7 +115,7 @@ public static string AutoHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Enable HDR on this monitor, based on the applications ähnelt. + /// Looks up a localized string similar to Enable HDR on this monitor, based on the applications. /// public static string AutoHDRToolTip { get { @@ -124,7 +124,7 @@ public static string AutoHDRToolTip { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Auto-Start ähnelt. + /// Looks up a localized string similar to Auto-Start. /// public static string AutoStart { get { @@ -133,7 +133,7 @@ public static string AutoStart { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Buy me a beer! ähnelt. + /// Looks up a localized string similar to Buy me a beer!. /// public static string BuyBeer { get { @@ -142,7 +142,7 @@ public static string BuyBeer { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Changelog ähnelt. + /// Looks up a localized string similar to Changelog. /// public static string Changelog { get { @@ -151,7 +151,7 @@ public static string Changelog { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Check for new version on startup ähnelt. + /// Looks up a localized string similar to Check for new version on startup. /// public static string CheckForNewVersion { get { @@ -160,7 +160,7 @@ public static string CheckForNewVersion { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Choose application ähnelt. + /// Looks up a localized string similar to Choose application. /// public static string ChooseApplication { get { @@ -169,7 +169,7 @@ public static string ChooseApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Choose UWP app... ähnelt. + /// Looks up a localized string similar to Choose UWP app.... /// public static string ChooseUWPApplication { get { @@ -178,7 +178,7 @@ public static string ChooseUWPApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Restarts the application on first occurence, as the application may need HDR to be activated before launching it. ähnelt. + /// Looks up a localized string similar to Restarts the application on first occurence, as the application may need HDR to be activated before launching it.. /// public static string CompatibilityModeToolTip { get { @@ -187,7 +187,7 @@ public static string CompatibilityModeToolTip { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Current application ähnelt. + /// Looks up a localized string similar to Current application. /// public static string CurrentApplication { get { @@ -196,7 +196,7 @@ public static string CurrentApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Deactivate HDR ähnelt. + /// Looks up a localized string similar to Deactivate HDR. /// public static string DeactivateHDR { get { @@ -205,7 +205,7 @@ public static string DeactivateHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Device ID ähnelt. + /// Looks up a localized string similar to Device ID. /// public static string DeviceID { get { @@ -214,7 +214,7 @@ public static string DeviceID { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Display name ähnelt. + /// Looks up a localized string similar to Display name. /// public static string DisplayName { get { @@ -223,7 +223,7 @@ public static string DisplayName { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Download from GitHub ähnelt. + /// Looks up a localized string similar to Download from GitHub. /// public static string Download { get { @@ -232,7 +232,7 @@ public static string Download { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Download ähnelt. + /// Looks up a localized string similar to Download. /// public static string DownloadNewestVersion { get { @@ -241,7 +241,7 @@ public static string DownloadNewestVersion { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Error ähnelt. + /// Looks up a localized string similar to Error. /// public static string Error { get { @@ -250,7 +250,7 @@ public static string Error { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Failed to restart application. ähnelt. + /// Looks up a localized string similar to Failed to restart application.. /// public static string ExceptionRestartProcess { get { @@ -259,7 +259,7 @@ public static string ExceptionRestartProcess { } /// - /// Sucht eine lokalisierte Zeichenfolge, die File path ähnelt. + /// Looks up a localized string similar to File path. /// public static string FilePath { get { @@ -268,7 +268,7 @@ public static string FilePath { } /// - /// Sucht eine lokalisierte Zeichenfolge, die GitHub ähnelt. + /// Looks up a localized string similar to GitHub. /// public static string GitHub { get { @@ -277,7 +277,7 @@ public static string GitHub { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Use automated HDR Mode for all monitors ähnelt. + /// Looks up a localized string similar to Use automated HDR Mode for all monitors. /// public static string GlobalAutoHDR { get { @@ -286,7 +286,16 @@ public static string GlobalAutoHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die HDR ähnelt. + /// Looks up a localized string similar to Desktop is using HDR. + /// + public static string GlobalDesktopDefaultHDROnOff { + get { + return ResourceManager.GetString("GlobalDesktopDefaultHDROnOff", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to HDR. /// public static string HDR { get { @@ -295,7 +304,7 @@ public static string HDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Auto HDR Mode ähnelt. + /// Looks up a localized string similar to Auto HDR Mode. /// public static string HDRMode { get { @@ -304,7 +313,7 @@ public static string HDRMode { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Icon ähnelt. + /// Looks up a localized string similar to Icon. /// public static string Icon { get { @@ -313,7 +322,7 @@ public static string Icon { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Info ähnelt. + /// Looks up a localized string similar to Info. /// public static string Info { get { @@ -322,7 +331,7 @@ public static string Info { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Local ähnelt. + /// Looks up a localized string similar to Local. /// public static string Local { get { @@ -331,7 +340,7 @@ public static string Local { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Logging ähnelt. + /// Looks up a localized string similar to Logging. /// public static string Logging { get { @@ -340,7 +349,7 @@ public static string Logging { } /// - /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Icon ähnlich wie (Symbol). + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). /// public static System.Drawing.Icon Logo { get { @@ -350,7 +359,7 @@ public static System.Drawing.Icon Logo { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Automated HDR mode ähnelt. + /// Looks up a localized string similar to Automated HDR mode. /// public static string ManagedHDR { get { @@ -359,7 +368,7 @@ public static string ManagedHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Close to tray ähnelt. + /// Looks up a localized string similar to Close to tray. /// public static string MinimizeToTray { get { @@ -368,7 +377,7 @@ public static string MinimizeToTray { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Monitors ähnelt. + /// Looks up a localized string similar to Monitors. /// public static string Monitors { get { @@ -377,7 +386,7 @@ public static string Monitors { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Name ähnelt. + /// Looks up a localized string similar to Name. /// public static string Name { get { @@ -386,7 +395,7 @@ public static string Name { } /// - /// Sucht eine lokalisierte Zeichenfolge, die No application is running ähnelt. + /// Looks up a localized string similar to No application is running. /// public static string NoApplication { get { @@ -395,7 +404,7 @@ public static string NoApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die OK ähnelt. + /// Looks up a localized string similar to OK. /// public static string OK { get { @@ -404,7 +413,7 @@ public static string OK { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Online ähnelt. + /// Looks up a localized string similar to Online. /// public static string Online { get { @@ -413,7 +422,7 @@ public static string Online { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Open ähnelt. + /// Looks up a localized string similar to Open. /// public static string Open { get { @@ -422,7 +431,16 @@ public static string Open { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Refresh rate [Hz] ähnelt. + /// Looks up a localized string similar to Prevent HDR. + /// + public static string PreventHDROnProgramStart { + get { + return ResourceManager.GetString("PreventHDROnProgramStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Refresh rate [Hz]. /// public static string RefreshRate { get { @@ -431,7 +449,7 @@ public static string RefreshRate { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Release date ähnelt. + /// Looks up a localized string similar to Release date. /// public static string ReleaseDate { get { @@ -440,7 +458,7 @@ public static string ReleaseDate { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Remove application ähnelt. + /// Looks up a localized string similar to Remove application. /// public static string RemoveApplication { get { @@ -449,7 +467,7 @@ public static string RemoveApplication { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Resolution ähnelt. + /// Looks up a localized string similar to Resolution. /// public static string Resolution { get { @@ -458,7 +476,7 @@ public static string Resolution { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Compatibility mode ähnelt. + /// Looks up a localized string similar to Compatibility mode. /// public static string RestartProccessOnFirstOccurence { get { @@ -467,7 +485,7 @@ public static string RestartProccessOnFirstOccurence { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Settings ähnelt. + /// Looks up a localized string similar to Settings. /// public static string Settings { get { @@ -476,7 +494,7 @@ public static string Settings { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Exit application ähnelt. + /// Looks up a localized string similar to Exit application. /// public static string Shutdown { get { @@ -485,7 +503,7 @@ public static string Shutdown { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Start in HDR-Mode ähnelt. + /// Looks up a localized string similar to Start in HDR-Mode. /// public static string StartInHDR { get { @@ -494,7 +512,7 @@ public static string StartInHDR { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Start to tray ähnelt. + /// Looks up a localized string similar to Start to tray. /// public static string StartToTray { get { @@ -503,7 +521,7 @@ public static string StartToTray { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Status ähnelt. + /// Looks up a localized string similar to Status. /// public static string Status { get { @@ -512,7 +530,7 @@ public static string Status { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Version ähnelt. + /// Looks up a localized string similar to Version. /// public static string Version { get { @@ -521,7 +539,7 @@ public static string Version { } /// - /// Sucht eine lokalisierte Zeichenfolge, die Volume sync devices ähnelt. + /// Looks up a localized string similar to Volume sync devices. /// public static string VolumeSyncDevices { get { diff --git a/Source/HDRProfile/ProjectResources/Locale_Texts.de.resx b/Source/HDRProfile/ProjectResources/Locale_Texts.de.resx index 026a943..c8508c6 100644 --- a/Source/HDRProfile/ProjectResources/Locale_Texts.de.resx +++ b/Source/HDRProfile/ProjectResources/Locale_Texts.de.resx @@ -189,6 +189,9 @@ Automatischer HDR-Modus für alle Monitore verwenden + + Desktop benutzt HDR + HDR @@ -231,6 +234,9 @@ Öffnen + + Stoppe HDR + Bildwiederholrate [Hz] diff --git a/Source/HDRProfile/ProjectResources/Locale_Texts.resx b/Source/HDRProfile/ProjectResources/Locale_Texts.resx index aa90aff..7a17436 100644 --- a/Source/HDRProfile/ProjectResources/Locale_Texts.resx +++ b/Source/HDRProfile/ProjectResources/Locale_Texts.resx @@ -192,6 +192,9 @@ Use automated HDR Mode for all monitors + + Desktop is using HDR + HDR @@ -238,6 +241,9 @@ Open + + Prevent HDR + Refresh rate [Hz] 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/HDRActivationMode.cs b/Source/HDRProfile/ViewEnums.cs similarity index 80% rename from Source/HDRProfile/HDRActivationMode.cs rename to Source/HDRProfile/ViewEnums.cs index 939a016..f17d819 100644 --- a/Source/HDRProfile/HDRActivationMode.cs +++ b/Source/HDRProfile/ViewEnums.cs @@ -12,4 +12,9 @@ public enum HDRActivationMode Running, Focused } + public enum OnOff + { + ON, + OFF + } } 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 @@ - +