|
| 1 | +<?xml version="1.0" encoding="utf-8" ?> |
| 2 | +<Page |
| 3 | + x:Class="Microsoft.CmdPal.UI.Pages.GeneralPage" |
| 4 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 6 | + xmlns:controls="using:CommunityToolkit.WinUI.Controls" |
| 7 | + xmlns:converters="using:CommunityToolkit.WinUI.Converters" |
| 8 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 9 | + xmlns:local="using:Microsoft.CmdPal.UI.Pages" |
| 10 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 11 | + xmlns:ptControls="using:Microsoft.CmdPal.UI.Controls" |
| 12 | + xmlns:ui="using:CommunityToolkit.WinUI" |
| 13 | + xmlns:viewmodels="using:Microsoft.CmdPal.UI.ViewModels" |
| 14 | + mc:Ignorable="d"> |
| 15 | + <Grid> |
| 16 | + <Grid.RowDefinitions> |
| 17 | + <RowDefinition Height="Auto" /> |
| 18 | + <RowDefinition Height="*" /> |
| 19 | + </Grid.RowDefinitions> |
| 20 | + <TextBlock |
| 21 | + MaxWidth="1000" |
| 22 | + Style="{StaticResource TitleTextBlockStyle}" |
| 23 | + Text="General" /> |
| 24 | + <ScrollViewer Grid.Row="1" Padding="0,0,8,0"> |
| 25 | + <Grid Padding="8,16,8,8"> |
| 26 | + <StackPanel |
| 27 | + MaxWidth="1000" |
| 28 | + HorizontalAlignment="Stretch" |
| 29 | + Spacing="{StaticResource SettingsCardSpacing}"> |
| 30 | + |
| 31 | + <!-- |
| 32 | + I got these from the samples, but they break XAML hot-reloading, |
| 33 | + so I commented them out. |
| 34 | + --> |
| 35 | + |
| 36 | + <!--<StackPanel.ChildrenTransitions> |
| 37 | + <EntranceThemeTransition FromVerticalOffset="50" /> |
| 38 | + <RepositionThemeTransition IsStaggeringEnabled="False" /> |
| 39 | + </StackPanel.ChildrenTransitions>--> |
| 40 | + |
| 41 | + <controls:SettingsExpander |
| 42 | + Description="This key will open the Command Palette" |
| 43 | + Header="Activation key" |
| 44 | + HeaderIcon="{ui:FontIcon Glyph=}" |
| 45 | + IsExpanded="True"> |
| 46 | + <ptControls:ShortcutControl HotkeySettings="{x:Bind viewModel.Hotkey, Mode=TwoWay}" /> |
| 47 | + |
| 48 | + <controls:SettingsExpander.Items> |
| 49 | + <controls:SettingsCard |
| 50 | + Description="If enabled, the Command Palette will return to the home page when activated" |
| 51 | + Header="Go home when activated" |
| 52 | + HeaderIcon="{ui:FontIcon Glyph=}"> |
| 53 | + <ToggleSwitch IsOn="{x:Bind viewModel.HotkeyGoesHome, Mode=TwoWay}" /> |
| 54 | + </controls:SettingsCard> |
| 55 | + <controls:SettingsCard Description="When enabled, the previous search text will be selected when the app is opened" Header="Highlight search on activate"> |
| 56 | + <ToggleSwitch IsOn="{x:Bind viewModel.HighlightSearchOnActivate, Mode=TwoWay}" /> |
| 57 | + </controls:SettingsCard> |
| 58 | + </controls:SettingsExpander.Items> |
| 59 | + </controls:SettingsExpander> |
| 60 | + |
| 61 | + <controls:SettingsCard |
| 62 | + Description="Controls if app details are automatically expanded or not" |
| 63 | + Header="Show app details" |
| 64 | + HeaderIcon="{ui:FontIcon Glyph=}"> |
| 65 | + <ToggleSwitch IsOn="{x:Bind viewModel.ShowAppDetails, Mode=TwoWay}" /> |
| 66 | + </controls:SettingsCard> |
| 67 | + |
| 68 | + <controls:SettingsCard |
| 69 | + Description="When enabled, pressing backspace when the search text is empty will take you back" |
| 70 | + Header="Backspace goes back" |
| 71 | + HeaderIcon="{ui:FontIcon Glyph=}"> |
| 72 | + <ToggleSwitch IsOn="{x:Bind viewModel.BackspaceGoesBack, Mode=TwoWay}" /> |
| 73 | + </controls:SettingsCard> |
| 74 | + |
| 75 | + <controls:SettingsCard |
| 76 | + Description="When enabled, single click activates list items. When disabled, single click selects and double click activates." |
| 77 | + Header="Single-click activates" |
| 78 | + HeaderIcon="{ui:FontIcon Glyph=}"> |
| 79 | + <ToggleSwitch IsOn="{x:Bind viewModel.SingleClickActivates, Mode=TwoWay}" /> |
| 80 | + </controls:SettingsCard> |
| 81 | + |
| 82 | + <!-- Example 'About' section --> |
| 83 | + <TextBlock x:Uid="AboutSettingsHeader" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" /> |
| 84 | + |
| 85 | + <controls:SettingsExpander |
| 86 | + Description="© 2025. All rights reserved." |
| 87 | + Header="Windows Command Palette" |
| 88 | + HeaderIcon="{ui:BitmapIcon Source=ms-appx:///Assets/StoreLogo.png}"> |
| 89 | + <TextBlock |
| 90 | + Foreground="{ThemeResource TextFillColorSecondaryBrush}" |
| 91 | + IsTextSelectionEnabled="True" |
| 92 | + Text="{x:Bind ApplicationVersion}" /> |
| 93 | + <controls:SettingsExpander.Items> |
| 94 | + <controls:SettingsCard HorizontalContentAlignment="Left" ContentAlignment="Left"> |
| 95 | + <StackPanel Margin="-12,0,0,0" Orientation="Vertical"> |
| 96 | + <HyperlinkButton Content="View GitHub Repo" NavigateUri="https://github.com/zadjii-msft/PowerToys" /> |
| 97 | + <HyperlinkButton Content="Extension SDK docs" NavigateUri="https://github.com/zadjii-msft/PowerToys/blob/main/src/modules/cmdpal/doc/initial-sdk-spec/initial-sdk-spec.md" /> |
| 98 | + </StackPanel> |
| 99 | + </controls:SettingsCard> |
| 100 | + </controls:SettingsExpander.Items> |
| 101 | + </controls:SettingsExpander> |
| 102 | + <HyperlinkButton |
| 103 | + Margin="0,8,0,0" |
| 104 | + Content="Send feedback" |
| 105 | + NavigateUri="https://github.com/zadjii-msft/PowerToys/issues/new" /> |
| 106 | + </StackPanel> |
| 107 | + </Grid> |
| 108 | + </ScrollViewer> |
| 109 | + </Grid> |
| 110 | +</Page> |
0 commit comments