PowerToys/src/settings-ui/Settings.UI/Views/ShortcutGuidePage.xaml
Okami Wong 89330986f4
[Shortcut Guide] Support delayed display of shortcuts except for taskbar shortcuts (#21762)
* Implement the delayed rendering

* Impelement settings UI

* Rename

* Set the minimum of ShortcutGuide_PressTimeForTaskbarIconShortcuts to 100ms

* Separate the animations of the global windows shortcuts and the taskbar icon shortcuts

* Amend

* Handle the case when the shortcut guide is not activated by win key long press

* Remove .vscode

* Keep the user's original setting of the win key press time

* Revert the default press time to 900 ms

* Restore default as 900
2022-11-18 14:22:40 +00:00

145 lines
9.3 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.ShortcutGuidePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters"
mc:Ignorable="d"
AutomationProperties.LandmarkType="Main">
<Page.Resources>
<converters:StringFormatConverter x:Key="StringFormatConverter"/>
<converters:BoolNegationConverter x:Key="BoolNegationConverter"/>
<converters:BoolToObjectConverter x:Key="BoolToComboBoxIndexConverter" TrueValue="1" FalseValue="0"/>
<converters:BoolToVisibilityConverter x:Key="TrueToVisibleConverter" TrueValue="Visible" FalseValue="Collapsed"/>
<converters:BoolToVisibilityConverter x:Key="FalseToVisibleConverter" TrueValue="Collapsed" FalseValue="Visible"/>
</Page.Resources>
<controls:SettingsPageControl x:Uid="ShortcutGuide"
ModuleImageSource="ms-appx:///Assets/Modules/ShortcutGuide.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical">
<controls:Setting x:Uid="ShortcutGuide_Enable" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
<controls:Setting.Icon>
<BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsShortcutGuide.png" ShowAsMonochrome="False" />
</controls:Setting.Icon>
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" x:Uid="ToggleSwitch"/>
</controls:Setting.ActionContent>
</controls:Setting>
<InfoBar x:Uid="GPO_IsSettingForced"
Severity="Informational"
IsClosable="False"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}" />
<controls:SettingsGroup x:Uid="Shortcut" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="ShortcutGuide_ActivationMethod">
<controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource BoolToComboBoxIndexConverter}}" MinWidth="{StaticResource SettingActionControlMinWidth}">
<ComboBoxItem x:Uid="Radio_ShortcutGuide_ActivationMethod_CustomizedShortcut"/>
<ComboBoxItem x:Uid="Radio_ShortcutGuide_ActivationMethod_LongPressWindowsKey"/>
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="Activation_Shortcut" Icon="&#xEDA7;" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource FalseToVisibleConverter}}">
<controls:Setting.ActionContent>
<controls:ShortcutControl HotkeySettings="{x:Bind Path=ViewModel.OpenShortcutGuide, Mode=TwoWay}"
MinWidth="{StaticResource SettingActionControlMinWidth}"/>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="ShortcutGuide_PressTimeForGlobalWindowsShortcuts" Icon="&#xE916;" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource TrueToVisibleConverter}}">
<controls:Setting.ActionContent>
<NumberBox
Minimum="100"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.PressTime}"
MinWidth="{StaticResource SettingActionControlMinWidth}"
SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left"
SmallChange="50"
LargeChange="100"
/>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="ShortcutGuide_PressTimeForTaskbarIconShortcuts" Icon="&#xE916;" Visibility="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior, Converter={StaticResource TrueToVisibleConverter}}">
<controls:Setting.ActionContent>
<NumberBox
Minimum="100"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.DelayTime}"
MinWidth="{StaticResource SettingActionControlMinWidth}"
SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left"
SmallChange="50"
LargeChange="100"
/>
</controls:Setting.ActionContent>
</controls:Setting>
<InfoBar
x:Uid="ShortcutGuide_PressWinKeyWarning"
Severity="Warning"
IsTabStop="True"
IsClosable="False"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.UseLegacyPressWinKeyBehavior}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="ShortcutGuide_Appearance_Behavior" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="ColorModeHeader" Icon="&#xE790;">
<controls:Setting.Description>
<HyperlinkButton Click="OpenColorsSettings_Click"
x:Uid="Windows_Color_Settings"/>
</controls:Setting.Description>
<controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.ThemeIndex}" MinWidth="{StaticResource SettingActionControlMinWidth}">
<ComboBoxItem x:Uid="Radio_Theme_Dark"/>
<ComboBoxItem x:Uid="Radio_Theme_Light"/>
<ComboBoxItem x:Uid="Radio_Theme_Default"/>
</ComboBox>
</controls:Setting.ActionContent>
</controls:Setting>
<controls:Setting x:Uid="ShortcutGuide_OverlayOpacity">
<controls:Setting.ActionContent>
<Slider Minimum="0"
Maximum="100"
MinWidth="{StaticResource SettingActionControlMinWidth}"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.OverlayOpacity}"/>
</controls:Setting.ActionContent>
</controls:Setting>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="ExcludedApps" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:SettingExpander IsExpanded="True">
<controls:SettingExpander.Header>
<controls:Setting x:Uid="ShortcutGuide_DisabledApps" Icon="&#xECE4;" Style="{StaticResource ExpanderHeaderSettingStyle}"/>
</controls:SettingExpander.Header>
<controls:SettingExpander.Content>
<TextBox x:Uid="ShortcutGuide_DisabledApps_TextBoxControl"
Margin="{StaticResource ExpanderSettingMargin}"
Text="{x:Bind Mode=TwoWay, Path=ViewModel.DisabledApps, UpdateSourceTrigger=PropertyChanged}"
ScrollViewer.VerticalScrollBarVisibility ="Visible"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.IsVerticalRailEnabled="True"
TextWrapping="Wrap"
AcceptsReturn="True"
MinWidth="240"
MinHeight="160" />
</controls:SettingExpander.Content>
</controls:SettingExpander>
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink x:Uid="LearnMore_ShortcutGuide" Link="https://aka.ms/PowerToysOverview_ShortcutGuide"/>
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>