PowerToys/src/settings-ui/Settings.UI/Views/FancyZonesPage.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

351 lines
23 KiB
XML

<Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
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="FancyZones"
ModuleImageSource="ms-appx:///Assets/Modules/FancyZones.png">
<controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical">
<labs:SettingsCard
x:Uid="FancyZones_EnableToggleControl_HeaderText"
HeaderIcon="{ui:BitmapIcon Source=/Assets/FluentIcons/FluentIconsFancyZones.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>
<controls:SettingsGroup
x:Uid="FancyZones_Editor_GroupSettings"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsCard
x:Uid="FancyZones_LaunchEditorButtonControl"
ActionIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, FontSize=14, Glyph=&#xE8A7;}"
Command="{x:Bind ViewModel.LaunchEditorEventHandler}"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xEB3C;}"
IsClickEnabled="True" />
<labs:SettingsCard
x:Uid="Activation_Shortcut"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xEDA7;}">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.EditorHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_UseCursorPosEditorStartupScreen"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xe7b5;}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.UseCursorPosEditorStartupScreen, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="FancyZones_LaunchPositionScreen" />
<ComboBoxItem x:Uid="FancyZones_LaunchPositionMouse" />
</ComboBox>
</labs:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Name="ZonesSettingsGroup"
x:Uid="FancyZones_Zones"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="FancyZones_ZoneBehavior_GroupSettings"
IsExpanded="True">
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_ShiftDragCheckBoxControl_Header"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ShiftDrag}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_MouseDragCheckBoxControl_Header"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MouseSwitch}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_ShowZonesOnAllMonitorsCheckBoxControl"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ShowOnAllMonitors}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<controls:CheckBoxWithDescriptionControl
x:Uid="FancyZones_SpanZonesAcrossMonitors"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.SpanZonesAcrossMonitors}" />
</labs:SettingsCard>
<labs:SettingsCard x:Uid="FancyZones_OverlappingZones">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{x:Bind Path=ViewModel.OverlappingZonesAlgorithmIndex, Mode=TwoWay}">
<ComboBoxItem x:Uid="FancyZones_OverlappingZonesSmallest" />
<ComboBoxItem x:Uid="FancyZones_OverlappingZonesLargest" />
<ComboBoxItem x:Uid="FancyZones_OverlappingZonesPositional" />
<ComboBoxItem x:Uid="FancyZones_OverlappingZonesClosestCenter" />
</ComboBox>
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
<labs:SettingsExpander
x:Uid="FancyZones_Zone_Appearance"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xEB3C;}"
IsExpanded="True">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.SystemTheme, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="FancyZones_Radio_Custom_Colors" />
<ComboBoxItem x:Uid="FancyZones_Radio_Default_Theme" />
</ComboBox>
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left">
<controls:FancyZonesPreviewControl
Width="170"
Height="86"
CustomBorderColor="{x:Bind Path=ViewModel.ZoneBorderColor, Mode=OneWay}"
CustomHighlightColor="{x:Bind Path=ViewModel.ZoneHighlightColor, Mode=OneWay}"
CustomInActiveColor="{x:Bind Path=ViewModel.ZoneInActiveColor, Mode=OneWay}"
CustomNumberColor="{x:Bind Path=ViewModel.ZoneNumberColor, Mode=OneWay}"
HighlightOpacity="{x:Bind Mode=OneWay, Path=ViewModel.HighlightOpacity}"
IsSystemTheme="{x:Bind Mode=OneWay, Path=ViewModel.SystemTheme}"
ShowZoneNumber="{x:Bind Path=ViewModel.ShowZoneNumber, Mode=OneWay}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_ShowZoneNumberCheckBoxControl"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ShowZoneNumber}" />
</labs:SettingsCard>
<labs:SettingsCard x:Uid="FancyZones_HighlightOpacity">
<Slider
MinWidth="{StaticResource SettingActionControlMinWidth}"
Maximum="100"
Minimum="0"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.HighlightOpacity}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_ZoneHighlightColor"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.SystemTheme, Converter={StaticResource ReverseBoolToVisibilityConverter}}">
<controls:ColorPickerButton SelectedColor="{x:Bind Path=ViewModel.ZoneHighlightColor, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_InActiveColor"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.SystemTheme, Converter={StaticResource ReverseBoolToVisibilityConverter}}">
<controls:ColorPickerButton
x:Name="InActiveColorButton"
SelectedColor="{x:Bind Path=ViewModel.ZoneInActiveColor, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_BorderColor"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.SystemTheme, Converter={StaticResource ReverseBoolToVisibilityConverter}}">
<controls:ColorPickerButton SelectedColor="{x:Bind Path=ViewModel.ZoneBorderColor, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_NumberColor"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.SystemTheme, Converter={StaticResource ReverseBoolToVisibilityConverter}}">
<controls:ColorPickerButton SelectedColor="{x:Bind Path=ViewModel.ZoneNumberColor, Mode=TwoWay}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="FancyZones_Windows"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="FancyZones_WindowBehavior_GroupSettings"
IsExpanded="True">
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_DisplayChangeMoveWindowsCheckBoxControl"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.DisplayChangeMoveWindows}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_ZoneSetChangeMoveWindows"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ZoneSetChangeMoveWindows}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_AppLastZoneMoveWindows"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.AppLastZoneMoveWindows}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_OpenWindowOnActiveMonitor"
IsChecked="{Binding Mode=TwoWay, Path=OpenWindowOnActiveMonitor}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_RestoreSize"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.RestoreSize}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_MakeDraggedWindowTransparentCheckBoxControl"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MakeDraggedWindowsTransparent}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<controls:CheckBoxWithDescriptionControl
x:Uid="FancyZones_AllowPopupWindowSnap"
Margin="0,0,0,6"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.AllowPopupWindowSnap}" />
</labs:SettingsCard>
<labs:SettingsCard ContentAlignment="Left">
<CheckBox
x:Uid="FancyZones_AllowChildWindowSnap"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.AllowChildWindowSnap}" />
</labs:SettingsCard>
<labs:SettingsCard
ContentAlignment="Left"
Visibility="{x:Bind Mode=OneWay, Path=ViewModel.Windows11, Converter={StaticResource BoolToVisibilityConverter}}">
<CheckBox
x:Uid="FancyZones_DisableRoundCornersOnWindowSnap"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.DisableRoundCornersOnWindowSnap}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
<labs:SettingsExpander
x:Uid="FancyZones_WindowSwitching_GroupSettings"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xEDA7;}"
IsExpanded="True">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.WindowSwitching}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard
x:Uid="FancyZones_HotkeyNextTabControl"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.WindowSwitchingCategoryEnabled}">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.NextTabHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
<labs:SettingsCard
x:Uid="FancyZones_HotkeyPrevTabControl"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.WindowSwitchingCategoryEnabled}">
<controls:ShortcutControl
MinWidth="{StaticResource SettingActionControlMinWidth}"
HotkeySettings="{x:Bind Path=ViewModel.PrevTabHotkey, Mode=TwoWay}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
<labs:SettingsExpander
x:Uid="FancyZones_OverrideSnapHotkeys"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xE90C;}"
IsExpanded="True">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideSnapHotkeys}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard
x:Uid="FancyZones_MoveWindow"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.SnapHotkeysCategoryEnabled}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
MinHeight="56"
SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.MoveWindowsBasedOnPosition, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="FancyZones_MoveWindowLeftRightBasedOnZoneIndex_Accessible">
<StackPanel
Orientation="Vertical"
Spacing="4">
<controls:IsEnabledTextBlock x:Uid="FancyZones_MoveWindowLeftRightBasedOnZoneIndex" />
<TextBlock
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Style="{StaticResource SecondaryTextStyle}">
<Run x:Uid="FancyZones_MoveWindowLeftRightBasedOnZoneIndex_Description" />
</TextBlock>
</StackPanel>
</ComboBoxItem>
<ComboBoxItem x:Uid="FancyZones_MoveWindowBasedOnRelativePosition_Accessible">
<StackPanel
Orientation="Vertical"
Spacing="4">
<controls:IsEnabledTextBlock x:Uid="FancyZones_MoveWindowBasedOnRelativePosition" />
<TextBlock
FontFamily="{ThemeResource SymbolThemeFontFamily}"
Style="{StaticResource SecondaryTextStyle}">
<Run x:Uid="FancyZones_MoveWindowBasedOnRelativePosition_Description" />
</TextBlock>
</StackPanel>
</ComboBoxItem>
</ComboBox>
</labs:SettingsCard>
<labs:SettingsCard
ContentAlignment="Left"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.SnapHotkeysCategoryEnabled}">
<CheckBox
x:Uid="FancyZones_MoveWindowsAcrossAllMonitorsCheckBoxControl"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MoveWindowsAcrossMonitors}" />
</labs:SettingsCard>
</labs:SettingsExpander.Items>
</labs:SettingsExpander>
</controls:SettingsGroup>
<controls:SettingsGroup
x:Uid="FancyZones_Layouts"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<labs:SettingsExpander
x:Uid="FancyZones_QuickLayoutSwitch"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xEDA7;}">
<ToggleSwitch
x:Uid="ToggleSwitch"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.QuickLayoutSwitch}" />
<labs:SettingsExpander.Items>
<labs:SettingsCard
ContentAlignment="Left"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.QuickSwitchEnabled}">
<CheckBox
x:Uid="FancyZones_FlashZonesOnQuickSwitch"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.FlashZonesOnQuickSwitch}" />
</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="FancyZones_ExcludeApps"
HeaderIcon="{ui:FontIcon FontFamily={StaticResource SymbolThemeFontFamily}, Glyph=&#xECE4;}"
IsExpanded="True">
<labs:SettingsExpander.Items>
<labs:SettingsCard ContentAlignment="Vertical" HorizontalContentAlignment="Stretch">
<TextBox
x:Uid="FancyZones_ExcludeApps_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_FancyZones"
Link="https://aka.ms/PowerToysOverview_FancyZones" />
</controls:SettingsPageControl.PrimaryLinks>
</controls:SettingsPageControl>
</Page>