[Settings] A11y fixes (2) (#13534)

* Replace radiobuttons with combobox

* Update Resources.resw

* Replaced radiobuttons with ComboBox

* Update ColorPickerPage.xaml

* Updates

* Typo fixes

* PR feedback

Co-authored-by: Laute <Niels.Laute@philips.com>
This commit is contained in:
Niels Laute
2021-10-03 16:48:50 +02:00
committed by GitHub
parent 84b2ae3e8f
commit fe1ee08df4
10 changed files with 143 additions and 251 deletions

View File

@@ -148,43 +148,19 @@ namespace Microsoft.PowerToys.Settings.UI.Library.ViewModels
}
}
public bool ActivationOpensEditor
public int ActivationBehavior
{
get => _colorPickerSettings.Properties.ActivationAction == ColorPickerActivationAction.OpenEditor;
set
get
{
if (value && _colorPickerSettings.Properties.ActivationAction != ColorPickerActivationAction.OpenEditor)
{
_colorPickerSettings.Properties.ActivationAction = ColorPickerActivationAction.OpenEditor;
OnPropertyChanged(nameof(ActivationOpensEditor));
NotifySettingsChanged();
}
return (int)_colorPickerSettings.Properties.ActivationAction;
}
}
public bool ActivationOpensColorPickerOnly
{
get => _colorPickerSettings.Properties.ActivationAction == ColorPickerActivationAction.OpenOnlyColorPicker;
set
{
if (value && _colorPickerSettings.Properties.ActivationAction != ColorPickerActivationAction.OpenOnlyColorPicker)
if (value != (int)_colorPickerSettings.Properties.ActivationAction)
{
_colorPickerSettings.Properties.ActivationAction = ColorPickerActivationAction.OpenOnlyColorPicker;
OnPropertyChanged(nameof(ActivationOpensColorPickerOnly));
NotifySettingsChanged();
}
}
}
public bool ActivationOpensColorPickerAndEditor
{
get => _colorPickerSettings.Properties.ActivationAction == ColorPickerActivationAction.OpenColorPickerAndThenEditor;
set
{
if (value && _colorPickerSettings.Properties.ActivationAction != ColorPickerActivationAction.OpenColorPickerAndThenEditor)
{
_colorPickerSettings.Properties.ActivationAction = ColorPickerActivationAction.OpenColorPickerAndThenEditor;
OnPropertyChanged(nameof(ActivationOpensEditor));
_colorPickerSettings.Properties.ActivationAction = (ColorPickerActivationAction)value;
OnPropertyChanged(nameof(ActivationBehavior));
NotifySettingsChanged();
}
}