[Settings] Reset Activation Key to Default Value (#26449)

* Add Default Value field to all controls

* Add reset button to Control field

* Improve button
Improve appearance
Add ToolTipService
Add AutomationProperties

* Move Reset button to Shortcut Dialog

* Fix Video Conferencing crash

* Change `Use Default` to `Reset`
This commit is contained in:
Sven
2023-06-20 15:42:04 +02:00
committed by GitHub
parent a883dcc283
commit 46ed52eab6
23 changed files with 127 additions and 78 deletions

View File

@@ -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));
}
}