diff --git a/src/settings-ui/Settings.UI/Assets/Settings/Icons/AssistiveTools.png b/src/settings-ui/Settings.UI/Assets/Settings/Icons/AssistiveTools.png new file mode 100644 index 0000000000..872fbdacca Binary files /dev/null and b/src/settings-ui/Settings.UI/Assets/Settings/Icons/AssistiveTools.png differ diff --git a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj index a6751adb98..2d18e97252 100644 --- a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj +++ b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj @@ -20,6 +20,7 @@ PowerToys.Settings.pri + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutControl.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutControl.xaml.cs index ba053e1124..0046803e87 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutControl.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutControl.xaml.cs @@ -674,15 +674,19 @@ namespace Microsoft.PowerToys.Settings.UI.Controls private async void OpenDialogButton_Click(object sender, RoutedEventArgs e) { c.Keys = null; - c.Keys = HotkeySettings.GetKeysList(); - c.IgnoreConflict = IgnoreConflict; - c.HasConflict = hotkeySettings.HasConflict; - c.ConflictMessage = hotkeySettings.ConflictDescription; + if (HotkeySettings != null) + { + c.Keys = HotkeySettings.GetKeysList(); - // 92 means the Win key. The logic is: warning should be visible if the shortcut contains Alt AND contains Ctrl AND NOT contains Win. - // Additional key must be present, as this is a valid, previously used shortcut shown at dialog open. Check for presence of non-modifier-key is not necessary therefore - c.IsWarningAltGr = c.Keys.Contains("Ctrl") && c.Keys.Contains("Alt") && !c.Keys.Contains(92); + c.IgnoreConflict = IgnoreConflict; + c.HasConflict = hotkeySettings.HasConflict; + c.ConflictMessage = hotkeySettings.ConflictDescription; + + // 92 means the Win key. The logic is: warning should be visible if the shortcut contains Alt AND contains Ctrl AND NOT contains Win. + // Additional key must be present, as this is a valid, previously used shortcut shown at dialog open. Check for presence of non-modifier-key is not necessary therefore + c.IsWarningAltGr = c.Keys.Contains("Ctrl") && c.Keys.Contains("Alt") && !c.Keys.Contains(92); + } shortcutDialog.XamlRoot = this.XamlRoot; shortcutDialog.RequestedTheme = this.ActualTheme; diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml new file mode 100644 index 0000000000..0d9d877fc7 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml.cs new file mode 100644 index 0000000000..ca9059d94a --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/AssistiveToolsPage.xaml.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.PowerToys.Settings.UI.Helpers; +using Microsoft.PowerToys.Settings.UI.Library; +using Microsoft.PowerToys.Settings.UI.ViewModels; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; + +namespace Microsoft.PowerToys.Settings.UI.Views +{ + public sealed partial class AssistiveToolsPage : NavigablePage, IRefreshablePage + { + private NewPlusViewModel ViewModel { get; set; } + + public AssistiveToolsPage() + { + InitializeComponent(); + } + + public void RefreshEnabledState() + { + ViewModel.RefreshEnabledState(); + } + + private void ControlModeSelectionBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (ControlModeSelectionBox.SelectedIndex == 1) + { + ReducedLineSpeedCard.Visibility = Visibility.Visible; + InitialSpeedCard.Visibility = Visibility.Visible; + } + else + { + ReducedLineSpeedCard.Visibility = Visibility.Collapsed; + InitialSpeedCard.Visibility = Visibility.Collapsed; + } + } + + private void ControlModeSelectionBox_Loaded(object sender, RoutedEventArgs e) + { + ControlModeSelectionBox.SelectionChanged += ControlModeSelectionBox_SelectionChanged; + } + } +} diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml index aae80d05e7..0dc2848744 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml @@ -289,6 +289,11 @@ +