PowerToys/src/settings-ui/Settings.UI/Views/AlwaysOnTopPage.xaml
Niels Laute f41fe145fc
[Settings] New Settings controls, XAML formatting and cleanup (#21317)
* Awake

* Always On Top

* ColorPicker

* FancyZones

* FancyZones

* Hosts file editor

* ImageResizer

* Update ImageResizerPage.xaml

* KBM

* General

* Update MeasureToolPage.xaml

* Mouse utils

* PowerAccent

* Run

* PowerOCR

* File preview

* PowerRename

* Shortcut Guide

* VCM

* XAML styler

* Update ShellPage.xaml

* XAML formatting and cleanup

* Moving converters

* Update App.xaml

* XAML formatting

* XAML formatting

* Fixes

* XAML formatting

* Image resizer updates

* Color picker page and margin tweaks

* Update PowerLauncherPage.xaml

* Tweaks based on Jay's feedback

* Resolve conflicts

* Add labs source to unit tests

* Fix feedback

* Fix KBM bug

* Infobar fix

* Fixes

* Resolve conflicts

* Add converter
2022-11-23 18:57:09 +00:00

155 lines
8.9 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.AlwaysOnTopPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:labs="using:CommunityToolkit.Labs.WinUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:CommunityToolkit.WinUI.UI"
AutomationProperties.LandmarkType="Main"
mc:Ignorable="d">
<controls:SettingsPageControl
x:Uid="AlwaysOnTop"
IsTabStop="False"
ModuleImageSource="ms-appx:///Assets/Modules/AlwaysOnTop.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical">
<labs:SettingsCard
x:Uid="AlwaysOnTop_EnableToggleControl_HeaderText"
HeaderIcon="{ui:BitmapIcon Source=/Assets/FluentIcons/FluentIconsAlwaysOnTop.png}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured, Converter={StaticResource BoolNegationConverter}}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
</labs:SettingsCard>
<InfoBar
x:Uid="GPO_IsSettingForced"
IsClosable="False"
IsOpen="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
IsTabStop="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabledGpoConfigured}"
Severity="Informational" />
<controls:SettingsGroup
x:Uid="AlwaysOnTop_Activation_GroupSettings"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="AlwaysOnTop_ActivationShortcut"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
Glyph=&#xEDA7;}"
IsExpanded="True">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.Hotkey, Mode=TwoWay}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="AlwaysOnTop_GameMode"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.DoNotActivateOnGameMode}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="AlwaysOnTop_Behavior_GroupSettings"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="AlwaysOnTop_FrameEnabled"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
Glyph=&#xEB3C;}"
IsExpanded="True">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.FrameEnabled}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard
x:Uid="AlwaysOnTop_FrameColor_Mode"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.FrameEnabled}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.FrameAccentColor, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="AlwaysOnTop_Radio_Custom_Color" />
<ComboBoxItem x:Uid="AlwaysOnTop_Radio_Windows_Default" />
</ComboBox>
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="AlwaysOnTop_FrameColor"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.FrameEnabled}"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.FrameAccentColor, Converter={StaticResource ReverseBoolToVisibilityConverter}}">
<controls:ColorPickerButton SelectedColor="{x:Bind Path=ViewModel.FrameColor, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="AlwaysOnTop_FrameThickness"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.FrameEnabled}">
<Slider
MinWidth="{StaticResource SettingActionControlMinWidth}"
LargeChange="5"
Maximum="30"
Minimum="1"
SmallChange="1"
Value="{x:Bind ViewModel.FrameThickness, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
ContentAlignment="Left"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.Windows11, Converter={StaticResource BoolToVisibilityConverter}}">
<CheckBox
x:Uid="AlwaysOnTop_RoundCorners"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.RoundCornersEnabled}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
<labs:SettingsExpander
x:Uid="AlwaysOnTop_SoundTitle"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
Glyph=&#xE7F3;}"
IsExpanded="True">
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="AlwaysOnTop_Sound"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.SoundEnabled}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="ExcludedApps"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="AlwaysOnTop_ExcludedApps"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily},
Glyph=&#xECE4;}"
IsExpanded="True">
<labs:SettingsExpander.Items>
<labs:SettingsCard
HorizontalContentAlignment="Stretch"
ContentAlignment="Vertical">
<TextBox
x:Uid="AlwaysOnTop_ExcludedApps_TextBoxControl"
MinWidth="240"
MinHeight="160"
AcceptsReturn="True"
ScrollViewer.IsVerticalRailEnabled="True"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollMode="Enabled"
Text="{x:Bind Mode=TwoWay, Path=ViewModel.ExcludedApps, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
</StackPanel>
</controls:SettingsPageControl.ModuleContent>
<controls:SettingsPageControl.PrimaryLinks>
<controls:PageLink
x:Uid="LearnMore_AlwaysOnTop"
Link="https://aka.ms/PowerToysOverview_AlwaysOnTop" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>