diff --git a/src/settings-ui/Settings.UI.Library/ColorPickerProperties.cs b/src/settings-ui/Settings.UI.Library/ColorPickerProperties.cs index 1629148f2b..09dde9318c 100644 --- a/src/settings-ui/Settings.UI.Library/ColorPickerProperties.cs +++ b/src/settings-ui/Settings.UI.Library/ColorPickerProperties.cs @@ -12,9 +12,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class ColorPickerProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x43); + public ColorPickerProperties() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x43); + ActivationShortcut = DefaultActivationShortcut; ChangeCursor = false; ColorHistoryLimit = 20; VisibleColorFormats = new Dictionary>(); diff --git a/src/settings-ui/Settings.UI.Library/ColorPickerPropertiesVersion1.cs b/src/settings-ui/Settings.UI.Library/ColorPickerPropertiesVersion1.cs index 909bec5554..2f45fcc911 100644 --- a/src/settings-ui/Settings.UI.Library/ColorPickerPropertiesVersion1.cs +++ b/src/settings-ui/Settings.UI.Library/ColorPickerPropertiesVersion1.cs @@ -11,9 +11,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class ColorPickerPropertiesVersion1 { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x43); + public ColorPickerPropertiesVersion1() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x43); + ActivationShortcut = DefaultActivationShortcut; ChangeCursor = false; ColorHistory = new List(); ColorHistoryLimit = 20; diff --git a/src/settings-ui/Settings.UI.Library/MeasureToolProperties.cs b/src/settings-ui/Settings.UI.Library/MeasureToolProperties.cs index a3cdadc7d4..59841978e4 100644 --- a/src/settings-ui/Settings.UI.Library/MeasureToolProperties.cs +++ b/src/settings-ui/Settings.UI.Library/MeasureToolProperties.cs @@ -10,9 +10,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class MeasureToolProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x4D); + public MeasureToolProperties() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x4D); + ActivationShortcut = DefaultActivationShortcut; UnitsOfMeasure = new IntProperty(0); PixelTolerance = new IntProperty(30); ContinuousCapture = false; diff --git a/src/settings-ui/Settings.UI.Library/MouseHighlighterProperties.cs b/src/settings-ui/Settings.UI.Library/MouseHighlighterProperties.cs index 5e1a4746fb..2f11ff33b2 100644 --- a/src/settings-ui/Settings.UI.Library/MouseHighlighterProperties.cs +++ b/src/settings-ui/Settings.UI.Library/MouseHighlighterProperties.cs @@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class MouseHighlighterProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x48); + [JsonPropertyName("activation_shortcut")] public HotkeySettings ActivationShortcut { get; set; } @@ -31,7 +33,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library public MouseHighlighterProperties() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x48); + ActivationShortcut = DefaultActivationShortcut; LeftButtonClickColor = new StringProperty("#FFFF00"); RightButtonClickColor = new StringProperty("#0000FF"); HighlightOpacity = new IntProperty(65); diff --git a/src/settings-ui/Settings.UI.Library/MouseJumpProperties.cs b/src/settings-ui/Settings.UI.Library/MouseJumpProperties.cs index 524039b06e..6f8b3db52a 100644 --- a/src/settings-ui/Settings.UI.Library/MouseJumpProperties.cs +++ b/src/settings-ui/Settings.UI.Library/MouseJumpProperties.cs @@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class MouseJumpProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x44); + [JsonPropertyName("activation_shortcut")] public HotkeySettings ActivationShortcut { get; set; } @@ -16,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library public MouseJumpProperties() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x44); + ActivationShortcut = DefaultActivationShortcut; ThumbnailSize = new MouseJumpThumbnailSize(); } } diff --git a/src/settings-ui/Settings.UI.Library/MousePointerCrosshairsProperties.cs b/src/settings-ui/Settings.UI.Library/MousePointerCrosshairsProperties.cs index d07b0c7f60..0c1dde5722 100644 --- a/src/settings-ui/Settings.UI.Library/MousePointerCrosshairsProperties.cs +++ b/src/settings-ui/Settings.UI.Library/MousePointerCrosshairsProperties.cs @@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class MousePointerCrosshairsProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, true, false, 0x50); // Win + Alt + P + [JsonPropertyName("activation_shortcut")] public HotkeySettings ActivationShortcut { get; set; } @@ -31,7 +33,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library public MousePointerCrosshairsProperties() { - ActivationShortcut = new HotkeySettings(true, false, true, false, 0x50); // Win + Alt + P + ActivationShortcut = DefaultActivationShortcut; CrosshairsColor = new StringProperty("#FF0000"); CrosshairsOpacity = new IntProperty(75); CrosshairsRadius = new IntProperty(20); diff --git a/src/settings-ui/Settings.UI.Library/PastePlainProperties.cs b/src/settings-ui/Settings.UI.Library/PastePlainProperties.cs index 5e4fcbcd14..a2537dd9fd 100644 --- a/src/settings-ui/Settings.UI.Library/PastePlainProperties.cs +++ b/src/settings-ui/Settings.UI.Library/PastePlainProperties.cs @@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class PastePlainProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, true, true, false, 0x56); // Ctrl+Win+Alt+V + public PastePlainProperties() { - ActivationShortcut = new HotkeySettings(true, true, true, false, 0x56); // Ctrl+Win+Alt+V + ActivationShortcut = DefaultActivationShortcut; } public HotkeySettings ActivationShortcut { get; set; } diff --git a/src/settings-ui/Settings.UI.Library/PeekProperties.cs b/src/settings-ui/Settings.UI.Library/PeekProperties.cs index f5dd72b24d..8635d184b0 100644 --- a/src/settings-ui/Settings.UI.Library/PeekProperties.cs +++ b/src/settings-ui/Settings.UI.Library/PeekProperties.cs @@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class PeekProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(false, true, false, false, 0x20); + public PeekProperties() { - ActivationShortcut = new HotkeySettings(false, true, false, false, 0x20); + ActivationShortcut = DefaultActivationShortcut; AlwaysRunNotElevated = new BoolProperty(true); CloseAfterLosingFocus = new BoolProperty(false); } diff --git a/src/settings-ui/Settings.UI.Library/PowerLauncherProperties.cs b/src/settings-ui/Settings.UI.Library/PowerLauncherProperties.cs index d495203e4e..455d4467c0 100644 --- a/src/settings-ui/Settings.UI.Library/PowerLauncherProperties.cs +++ b/src/settings-ui/Settings.UI.Library/PowerLauncherProperties.cs @@ -75,11 +75,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library [JsonPropertyName("generate_thumbnails_from_files")] public bool GenerateThumbnailsFromFiles { get; set; } + public HotkeySettings DefaultOpenPowerLauncher => new HotkeySettings(false, false, true, false, 32); + + public HotkeySettings DefaultOpenFileLocation => new HotkeySettings(); + + public HotkeySettings DefaultCopyPathLocation => new HotkeySettings(); + public PowerLauncherProperties() { - OpenPowerLauncher = new HotkeySettings(false, false, true, false, 32); - OpenFileLocation = new HotkeySettings(); - CopyPathLocation = new HotkeySettings(); + OpenPowerLauncher = DefaultOpenPowerLauncher; + OpenFileLocation = DefaultOpenFileLocation; + CopyPathLocation = DefaultCopyPathLocation; OpenConsole = new HotkeySettings(); SearchResultPreference = "most_recently_used"; SearchTypePreference = "application_name"; diff --git a/src/settings-ui/Settings.UI.Library/PowerOcrProperties.cs b/src/settings-ui/Settings.UI.Library/PowerOcrProperties.cs index 903fd5f1bc..48e1018b71 100644 --- a/src/settings-ui/Settings.UI.Library/PowerOcrProperties.cs +++ b/src/settings-ui/Settings.UI.Library/PowerOcrProperties.cs @@ -8,9 +8,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class PowerOcrProperties { + public HotkeySettings DefaultActivationShortcut => new HotkeySettings(true, false, false, true, 0x54); // Win+Shift+T + public PowerOcrProperties() { - ActivationShortcut = new HotkeySettings(true, false, false, true, 0x54); // Win+Shift+T + ActivationShortcut = DefaultActivationShortcut; PreferredLanguage = string.Empty; } diff --git a/src/settings-ui/Settings.UI.Library/ShortcutGuideProperties.cs b/src/settings-ui/Settings.UI.Library/ShortcutGuideProperties.cs index 7112b5ae80..e942b61ca2 100644 --- a/src/settings-ui/Settings.UI.Library/ShortcutGuideProperties.cs +++ b/src/settings-ui/Settings.UI.Library/ShortcutGuideProperties.cs @@ -8,6 +8,8 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class ShortcutGuideProperties { + public HotkeySettings DefaultOpenShortcutGuide => new HotkeySettings(true, false, false, true, 0xBF); + public ShortcutGuideProperties() { OverlayOpacity = new IntProperty(90); @@ -16,7 +18,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library PressTimeForTaskbarIconShortcuts = new IntProperty(900); Theme = new StringProperty("system"); DisabledApps = new StringProperty(); - OpenShortcutGuide = new HotkeySettings(true, false, false, true, 0xBF); + OpenShortcutGuide = DefaultOpenShortcutGuide; } [JsonPropertyName("open_shortcutguide")] diff --git a/src/settings-ui/Settings.UI.Library/VideoConferenceConfigProperties.cs b/src/settings-ui/Settings.UI.Library/VideoConferenceConfigProperties.cs index 00eea891c1..964332bd90 100644 --- a/src/settings-ui/Settings.UI.Library/VideoConferenceConfigProperties.cs +++ b/src/settings-ui/Settings.UI.Library/VideoConferenceConfigProperties.cs @@ -9,53 +9,54 @@ namespace Microsoft.PowerToys.Settings.UI.Library { public class VideoConferenceConfigProperties { + public HotkeySettings DefaultMuteCameraAndMicrophoneHotkey => new HotkeySettings() + { + Win = true, + Ctrl = false, + Alt = false, + Shift = true, + Key = "Q", + Code = 81, + }; + + public HotkeySettings DefaultMuteMicrophoneHotkey => new HotkeySettings() + { + Win = true, + Ctrl = false, + Alt = false, + Shift = true, + Key = "A", + Code = 65, + }; + + public HotkeySettings DefaultPushToTalkMicrophoneHotkey => new HotkeySettings() + { + Win = true, + Ctrl = false, + Alt = false, + Shift = true, + Key = "I", + Code = 73, + }; + + public HotkeySettings DefaultMuteCameraHotkey => new HotkeySettings() + { + Win = true, + Ctrl = false, + Alt = false, + Shift = true, + Key = "O", + Code = 79, + }; + public VideoConferenceConfigProperties() { - this.MuteCameraAndMicrophoneHotkey = new KeyboardKeysProperty( - new HotkeySettings() - { - Win = true, - Ctrl = false, - Alt = false, - Shift = true, - Key = "Q", - Code = 81, - }); + MuteCameraAndMicrophoneHotkey = new KeyboardKeysProperty(DefaultMuteCameraAndMicrophoneHotkey); + MuteMicrophoneHotkey = new KeyboardKeysProperty(DefaultMuteMicrophoneHotkey); + PushToTalkMicrophoneHotkey = new KeyboardKeysProperty(DefaultPushToTalkMicrophoneHotkey); + MuteCameraHotkey = new KeyboardKeysProperty(DefaultMuteCameraHotkey); - this.MuteMicrophoneHotkey = new KeyboardKeysProperty( - new HotkeySettings() - { - Win = true, - Ctrl = false, - Alt = false, - Shift = true, - Key = "A", - Code = 65, - }); - - this.PushToTalkMicrophoneHotkey = new KeyboardKeysProperty( - new HotkeySettings() - { - Win = true, - Ctrl = false, - Alt = false, - Shift = true, - Key = "I", - Code = 73, - }); - - this.MuteCameraHotkey = new KeyboardKeysProperty( - new HotkeySettings() - { - Win = true, - Ctrl = false, - Alt = false, - Shift = true, - Key = "O", - Code = 79, - }); - - this.PushToReverseEnabled = new BoolProperty(false); + PushToReverseEnabled = new BoolProperty(false); } [JsonPropertyName("mute_camera_and_microphone_hotkey")] diff --git a/src/settings-ui/Settings.UI/Controls/ShortcutControl/ShortcutControl.xaml.cs b/src/settings-ui/Settings.UI/Controls/ShortcutControl/ShortcutControl.xaml.cs index c9b9035049..1f67da290b 100644 --- a/src/settings-ui/Settings.UI/Controls/ShortcutControl/ShortcutControl.xaml.cs +++ b/src/settings-ui/Settings.UI/Controls/ShortcutControl/ShortcutControl.xaml.cs @@ -101,10 +101,12 @@ namespace Microsoft.PowerToys.Settings.UI.Controls Title = resourceLoader.GetString("Activation_Shortcut_Title"), Content = c, PrimaryButtonText = resourceLoader.GetString("Activation_Shortcut_Save"), + SecondaryButtonText = resourceLoader.GetString("Activation_Shortcut_Reset"), CloseButtonText = resourceLoader.GetString("Activation_Shortcut_Cancel"), DefaultButton = ContentDialogButton.Primary, }; shortcutDialog.PrimaryButtonClick += ShortcutDialog_PrimaryButtonClick; + shortcutDialog.SecondaryButtonClick += ShortcutDialog_Reset; shortcutDialog.Opened += ShortcutDialog_Opened; shortcutDialog.Closing += ShortcutDialog_Closing; AutomationProperties.SetName(EditButton, resourceLoader.GetString("Activation_Shortcut_Title")); @@ -355,6 +357,19 @@ namespace Microsoft.PowerToys.Settings.UI.Controls await shortcutDialog.ShowAsync(); } + private void ShortcutDialog_Reset(ContentDialog sender, ContentDialogButtonClickEventArgs args) + { + hotkeySettings = null; + + SetValue(HotkeySettingsProperty, hotkeySettings); + PreviewKeysControl.ItemsSource = HotkeySettings.GetKeysList(); + + lastValidSettings = hotkeySettings; + + AutomationProperties.SetHelpText(EditButton, HotkeySettings.ToString()); + shortcutDialog.Hide(); + } + private void ShortcutDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) { if (ComboIsValid(lastValidSettings)) diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 0e91859f34..0d519fce76 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -2469,7 +2469,10 @@ From there, simply click on one of the supported files in the File Explorer and Cancel - Press a combination of keys to change this shortcut + Press a combination of keys to change this shortcut + + + Reset Save diff --git a/src/settings-ui/Settings.UI/ViewModels/ColorPickerViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/ColorPickerViewModel.cs index 6f27fbab83..328f52e735 100644 --- a/src/settings-ui/Settings.UI/ViewModels/ColorPickerViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/ColorPickerViewModel.cs @@ -148,7 +148,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (_colorPickerSettings.Properties.ActivationShortcut != value) { - _colorPickerSettings.Properties.ActivationShortcut = value; + _colorPickerSettings.Properties.ActivationShortcut = value ?? _colorPickerSettings.Properties.DefaultActivationShortcut; OnPropertyChanged(nameof(ActivationShortcut)); NotifySettingsChanged(); } diff --git a/src/settings-ui/Settings.UI/ViewModels/MeasureToolViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/MeasureToolViewModel.cs index bf0639a307..2823ecf306 100644 --- a/src/settings-ui/Settings.UI/ViewModels/MeasureToolViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/MeasureToolViewModel.cs @@ -209,7 +209,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (Settings.Properties.ActivationShortcut != value) { - Settings.Properties.ActivationShortcut = value; + Settings.Properties.ActivationShortcut = value ?? Settings.Properties.DefaultActivationShortcut; NotifyPropertyChanged(); diff --git a/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs index e781e92a7e..278026d43d 100644 --- a/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/MouseUtilsViewModel.cs @@ -427,7 +427,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (MouseHighlighterSettingsConfig.Properties.ActivationShortcut != value) { - MouseHighlighterSettingsConfig.Properties.ActivationShortcut = value; + MouseHighlighterSettingsConfig.Properties.ActivationShortcut = value ?? MouseHighlighterSettingsConfig.Properties.DefaultActivationShortcut; NotifyMouseHighlighterPropertyChanged(); } } @@ -595,7 +595,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (MouseJumpSettingsConfig.Properties.ActivationShortcut != value) { - MouseJumpSettingsConfig.Properties.ActivationShortcut = value; + MouseJumpSettingsConfig.Properties.ActivationShortcut = value ?? MouseJumpSettingsConfig.Properties.DefaultActivationShortcut; NotifyMouseJumpPropertyChanged(); } } @@ -676,7 +676,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut != value) { - MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut = value; + MousePointerCrosshairsSettingsConfig.Properties.ActivationShortcut = value ?? MousePointerCrosshairsSettingsConfig.Properties.DefaultActivationShortcut; NotifyMousePointerCrosshairsPropertyChanged(); } } diff --git a/src/settings-ui/Settings.UI/ViewModels/PastePlainViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PastePlainViewModel.cs index 868c0f942c..1037ca07d0 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PastePlainViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PastePlainViewModel.cs @@ -126,7 +126,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (_pastePlainSettings.Properties.ActivationShortcut != value) { - _pastePlainSettings.Properties.ActivationShortcut = value; + _pastePlainSettings.Properties.ActivationShortcut = value ?? _pastePlainSettings.Properties.DefaultActivationShortcut; OnPropertyChanged(nameof(ActivationShortcut)); OnPropertyChanged(nameof(IsConflictingCopyShortcut)); diff --git a/src/settings-ui/Settings.UI/ViewModels/PeekViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PeekViewModel.cs index ddc484955c..3e84331da3 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PeekViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PeekViewModel.cs @@ -102,7 +102,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (_peekSettings.Properties.ActivationShortcut != value) { - _peekSettings.Properties.ActivationShortcut = value; + _peekSettings.Properties.ActivationShortcut = value ?? _peekSettings.Properties.DefaultActivationShortcut; OnPropertyChanged(nameof(ActivationShortcut)); NotifySettingsChanged(); } diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerLauncherViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerLauncherViewModel.cs index 997c26921a..caf1d80c09 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerLauncherViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerLauncherViewModel.cs @@ -319,7 +319,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (settings.Properties.OpenPowerLauncher != value) { - settings.Properties.OpenPowerLauncher = value; + settings.Properties.OpenPowerLauncher = value ?? settings.Properties.DefaultOpenPowerLauncher; UpdateSettings(); } } @@ -455,7 +455,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (settings.Properties.OpenFileLocation != value) { - settings.Properties.OpenFileLocation = value; + settings.Properties.OpenFileLocation = value ?? settings.Properties.DefaultOpenFileLocation; UpdateSettings(); } } @@ -472,7 +472,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (settings.Properties.CopyPathLocation != value) { - settings.Properties.CopyPathLocation = value; + settings.Properties.CopyPathLocation = value ?? settings.Properties.DefaultCopyPathLocation; UpdateSettings(); } } diff --git a/src/settings-ui/Settings.UI/ViewModels/PowerOcrViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/PowerOcrViewModel.cs index 0911051bb1..dc41e76d4a 100644 --- a/src/settings-ui/Settings.UI/ViewModels/PowerOcrViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/PowerOcrViewModel.cs @@ -158,7 +158,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (_powerOcrSettings.Properties.ActivationShortcut != value) { - _powerOcrSettings.Properties.ActivationShortcut = value; + _powerOcrSettings.Properties.ActivationShortcut = value ?? _powerOcrSettings.Properties.DefaultActivationShortcut; OnPropertyChanged(nameof(ActivationShortcut)); _settingsUtils.SaveSettings(_powerOcrSettings.ToJsonString(), PowerOcrSettings.ModuleName); diff --git a/src/settings-ui/Settings.UI/ViewModels/ShortcutGuideViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/ShortcutGuideViewModel.cs index b23800d294..5d9e643327 100644 --- a/src/settings-ui/Settings.UI/ViewModels/ShortcutGuideViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/ShortcutGuideViewModel.cs @@ -138,7 +138,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (Settings.Properties.OpenShortcutGuide != value) { - Settings.Properties.OpenShortcutGuide = value; + Settings.Properties.OpenShortcutGuide = value ?? Settings.Properties.DefaultOpenShortcutGuide; NotifyPropertyChanged(); } } diff --git a/src/settings-ui/Settings.UI/ViewModels/VideoConferenceViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/VideoConferenceViewModel.cs index 8450c5771a..9aec8e9a89 100644 --- a/src/settings-ui/Settings.UI/ViewModels/VideoConferenceViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/VideoConferenceViewModel.cs @@ -319,8 +319,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (value != _cameraAndMicrophoneMuteHotkey) { - _cameraAndMicrophoneMuteHotkey = value; - Settings.Properties.MuteCameraAndMicrophoneHotkey.Value = value; + var hotkey = value ?? Settings.Properties.DefaultMuteCameraAndMicrophoneHotkey; + _cameraAndMicrophoneMuteHotkey = hotkey; + Settings.Properties.MuteCameraAndMicrophoneHotkey.Value = hotkey; RaisePropertyChanged(nameof(CameraAndMicrophoneMuteHotkey)); } } @@ -337,8 +338,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (value != _microphoneMuteHotkey) { - _microphoneMuteHotkey = value; - Settings.Properties.MuteMicrophoneHotkey.Value = value; + var hotkey = value ?? Settings.Properties.DefaultMuteMicrophoneHotkey; + _microphoneMuteHotkey = hotkey; + Settings.Properties.MuteMicrophoneHotkey.Value = hotkey; RaisePropertyChanged(nameof(MicrophoneMuteHotkey)); } } @@ -355,8 +357,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (value != _microphonePushToTalkHotkey) { - _microphonePushToTalkHotkey = value; - Settings.Properties.PushToTalkMicrophoneHotkey.Value = value; + var hotkey = value ?? Settings.Properties.DefaultMuteMicrophoneHotkey; + _microphonePushToTalkHotkey = hotkey; + Settings.Properties.PushToTalkMicrophoneHotkey.Value = hotkey; RaisePropertyChanged(nameof(MicrophonePushToTalkHotkey)); } } @@ -391,8 +394,9 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { if (value != _cameraMuteHotkey) { - _cameraMuteHotkey = value; - Settings.Properties.MuteCameraHotkey.Value = value; + var hotkey = value ?? Settings.Properties.DefaultMuteCameraHotkey; + _cameraMuteHotkey = hotkey; + Settings.Properties.MuteCameraHotkey.Value = hotkey; RaisePropertyChanged(nameof(CameraMuteHotkey)); } }