[Settings]Change text color for disabled controls (#4837)

* change text color for disabled controls

* added custom textblock controls and updated FZ Xaml

* updated Image Resizer Page

* updated Shotcut Guid

* updated KBM Settings

* reverted unrealted changes

* reverted unrealted changes

* reverted unrealted changes

* reverted unrealted changes

* updated power launcher

* reverted unrealted changes

* Image Resizer: renoved spaces in file format hint text

* Image Resizer: restored file format header

Co-authored-by: Lavius Motileng <laviusntk>
This commit is contained in:
Nkateko
2020-07-17 11:01:46 -07:00
committed by GitHub
parent 13c2ce3f31
commit e8de6f0ace
20 changed files with 1204 additions and 707 deletions

View File

@@ -0,0 +1,28 @@
<UserControl
x:Class="Microsoft.PowerToys.Settings.UI.Controls.BodyTextBlock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<TextBlock x:Name="CustomTextBlock"
Style="{StaticResource BodyTextBlockStyle}"
Margin="{StaticResource SmallTopMargin}" >
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemColorGrayTextBrush}" />
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBlock>
</Grid>
</UserControl>

View File

@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace Microsoft.PowerToys.Settings.UI.Controls
{
public sealed partial class BodyTextBlock : UserControl
{
public static readonly DependencyProperty TextProperty =
DependencyProperty.Register(
"Text",
typeof(string),
typeof(GroupTitleTextBlock),
null);
public string _text;
public string Text
{
get
{
return _text;
}
set
{
_text = value;
CustomTextBlock.Text = value;
SetValue(TextProperty, value);
}
}
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"IsActive",
typeof(string),
typeof(GroupTitleTextBlock),
null);
private string _isActive = "False";
public string IsActive
{
get
{
return _isActive;
}
set
{
SetValue(IsActiveProperty, value);
_isActive = value;
CustomTextBlock.Tag = value;
}
}
private Windows.UI.Text.FontWeight _fontWeight;
public Windows.UI.Text.FontWeight FontWeight
{
get
{
return _fontWeight;
}
set
{
_fontWeight = value;
CustomTextBlock.FontWeight = value;
}
}
public BodyTextBlock()
{
this.InitializeComponent();
CustomTextBlock.Tag = "False";
}
}
}

View File

@@ -0,0 +1,29 @@
<UserControl
x:Class="Microsoft.PowerToys.Settings.UI.Controls.GroupTitleTextBlock"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid>
<TextBlock
x:Name="CustomTextBlock"
Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource MediumTopMargin}">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemColorGrayTextBrush}" />
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding Tag, ElementName=CustomTextBlock}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=CustomTextBlock}" PropertyName="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBlock>
</Grid>
</UserControl>

View File

@@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Popups;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
namespace Microsoft.PowerToys.Settings.UI.Controls
{
public sealed partial class GroupTitleTextBlock : UserControl
{
public string _text;
public string Text
{
get
{
return _text;
}
set
{
_text = value;
CustomTextBlock.Text = value;
}
}
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"IsActive",
typeof(string),
typeof(GroupTitleTextBlock),
null);
private string _isActive = "False";
public string IsActive
{
get
{
return _isActive;
}
set
{
SetValue(IsActiveProperty, value.ToString());
_isActive = value.ToString();
CustomTextBlock.Tag = value.ToString();
}
}
public GroupTitleTextBlock()
{
this.InitializeComponent();
DataContext = this;
CustomTextBlock.Tag = "False";
}
}
}

View File

@@ -17,6 +17,38 @@ namespace Microsoft.PowerToys.Settings.UI.Controls
{ {
public string Header { get; set; } public string Header { get; set; }
public static readonly DependencyProperty IsActiveProperty =
DependencyProperty.Register(
"Enabled",
typeof(string),
typeof(HotkeySettingsControl),
null);
private string _enabled = "False";
public string Enabled
{
get
{
return _enabled;
}
set
{
SetValue(IsActiveProperty, value);
_enabled = value;
if (value.ToString().ToLower() == "true")
{
HotkeyTextBox.IsEnabled = true;
}
else
{
HotkeyTextBox.IsEnabled = false;
}
}
}
public static readonly DependencyProperty HotkeySettingsProperty = public static readonly DependencyProperty HotkeySettingsProperty =
DependencyProperty.Register( DependencyProperty.Register(
"HotkeySettings", "HotkeySettings",

View File

@@ -93,6 +93,12 @@
</Compile> </Compile>
<Compile Include="Behaviors\NavigationViewHeaderBehavior.cs" /> <Compile Include="Behaviors\NavigationViewHeaderBehavior.cs" />
<Compile Include="Behaviors\NavigationViewHeaderMode.cs" /> <Compile Include="Behaviors\NavigationViewHeaderMode.cs" />
<Compile Include="Controls\BodyTextBlock.xaml.cs">
<DependentUpon>BodyTextBlock.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\GroupTitleTextBlock.xaml.cs">
<DependentUpon>GroupTitleTextBlock.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\HotkeySettingsControl.xaml.cs"> <Compile Include="Controls\HotkeySettingsControl.xaml.cs">
<DependentUpon>HotkeySettingsControl.xaml</DependentUpon> <DependentUpon>HotkeySettingsControl.xaml</DependentUpon>
</Compile> </Compile>
@@ -195,6 +201,14 @@
<PRIResource Include="Strings\en-us\Resources.resw" /> <PRIResource Include="Strings\en-us\Resources.resw" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Controls\BodyTextBlock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\GroupTitleTextBlock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\HotkeySettingsControl.xaml"> <Page Include="Controls\HotkeySettingsControl.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>

View File

@@ -226,7 +226,7 @@
<data name="PowerLauncher_SearchTypePreference_ExecutableName" xml:space="preserve"> <data name="PowerLauncher_SearchTypePreference_ExecutableName" xml:space="preserve">
<value>Executable name</value> <value>Executable name</value>
</data> </data>
<data name="PowerLauncher_MaximumNumberOfResults.Header" xml:space="preserve"> <data name="PowerLauncher_MaximumNumberOfResults.Text" xml:space="preserve">
<value>Maximum number of results</value> <value>Maximum number of results</value>
</data> </data>
<data name="PowerLauncher_Shortcuts.Text" xml:space="preserve"> <data name="PowerLauncher_Shortcuts.Text" xml:space="preserve">
@@ -389,7 +389,7 @@
<data name="PowerRename_Toggle_EnableOnExtendedContextMenu.Header" xml:space="preserve"> <data name="PowerRename_Toggle_EnableOnExtendedContextMenu.Header" xml:space="preserve">
<value>Appear only in extended context menu (Shift + Right-click)</value> <value>Appear only in extended context menu (Shift + Right-click)</value>
</data> </data>
<data name="PowerRename_Toggle_MaxDispListNum.Header" xml:space="preserve"> <data name="PowerRename_Toggle_MaxDispListNum.Text" xml:space="preserve">
<value>Maximum number of items</value> <value>Maximum number of items</value>
</data> </data>
<data name="PowerRename_Toggle_RestoreFlagsOnLaunch.Header" xml:space="preserve"> <data name="PowerRename_Toggle_RestoreFlagsOnLaunch.Header" xml:space="preserve">
@@ -428,7 +428,7 @@
<data name="ShortcutGuide_Description.Text" xml:space="preserve"> <data name="ShortcutGuide_Description.Text" xml:space="preserve">
<value>Shows a help overlay with Windows shortcuts when the Windows key is pressed.</value> <value>Shows a help overlay with Windows shortcuts when the Windows key is pressed.</value>
</data> </data>
<data name="ShortcutGuide_PressTime.Header" xml:space="preserve"> <data name="ShortcutGuide_PressTime.Text" xml:space="preserve">
<value>Press duration before showing (ms)</value> <value>Press duration before showing (ms)</value>
</data> </data>
<data name="ShortcutGuide_Appearance_Behavior.Text" xml:space="preserve"> <data name="ShortcutGuide_Appearance_Behavior.Text" xml:space="preserve">
@@ -440,7 +440,7 @@
<data name="ShortcutGuide_OverlayOpacity.Header" xml:space="preserve"> <data name="ShortcutGuide_OverlayOpacity.Header" xml:space="preserve">
<value>Opacity of background</value> <value>Opacity of background</value>
</data> </data>
<data name="ShortcutGuide_Theme.Header" xml:space="preserve"> <data name="ShortcutGuide_Theme.Text" xml:space="preserve">
<value>Choose Shortcut Guide overlay color</value> <value>Choose Shortcut Guide overlay color</value>
</data> </data>
<data name="ImageResizer_CustomSizes.Text" xml:space="preserve"> <data name="ImageResizer_CustomSizes.Text" xml:space="preserve">
@@ -608,4 +608,19 @@
<data name="FancyZones_RestoreSize.Content" xml:space="preserve"> <data name="FancyZones_RestoreSize.Content" xml:space="preserve">
<value>Restore the original size of windows when unsnapping</value> <value>Restore the original size of windows when unsnapping</value>
</data> </data>
<data name="ImageResizer_FallBackEncoderText.Header" xml:space="preserve">
<value>Fallback encoder</value>
</data>
<data name="ImageResizer_FileFormatDescription.Text" xml:space="preserve">
<value>The following parameters can be used:</value>
</data>
<data name="ImageResizer_FilenameFormatHeader.Header" xml:space="preserve">
<value>Filename format</value>
</data>
<data name="ImageResizer_UseOriginalDate.Content" xml:space="preserve">
<value>Use original date modified</value>
</data>
<data name="Encoding.Text" xml:space="preserve">
<value>Encoding</value>
</data>
</root> </root>

View File

@@ -32,4 +32,7 @@
<!--Extra Extra Small size margins--> <!--Extra Extra Small size margins-->
<Thickness x:Key="XXSmallTopMargin">0, 4, 0, 0</Thickness> <Thickness x:Key="XXSmallTopMargin">0, 4, 0, 0</Thickness>
<Thickness x:Key="XXSmallTopRightBottomMargin">0, 4, 4, 4</Thickness> <Thickness x:Key="XXSmallTopRightBottomMargin">0, 4, 4, 4</Thickness>
<!--Control Header Text Margin-->
<Thickness x:Key="HeaderTextTopMargin">0, 4, 0, 0</Thickness>
</ResourceDictionary> </ResourceDictionary>

View File

@@ -20,7 +20,173 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
private readonly SendCallback callback; private readonly SendCallback callback;
public PowerLauncherViewModel() public PowerLauncherViewModel()
{ {
callback = (PowerLauncherSettings settings) =>
{
// Propagate changes to Power Launcher through IPC
ShellPage.DefaultSndMSGCallback(
string.Format("{{ \"powertoys\": {{ \"{0}\": {1} }} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings)));
};
if (SettingsUtils.SettingsExists(PowerLauncherSettings.POWERTOYNAME))
{
settings = SettingsUtils.GetSettings<PowerLauncherSettings>(PowerLauncherSettings.POWERTOYNAME);
}
else
{
settings = new PowerLauncherSettings();
settings.properties.open_powerlauncher.Alt = true;
settings.properties.open_powerlauncher.Code = (int)Windows.System.VirtualKey.Space;
settings.properties.maximum_number_of_results = 4;
callback(settings);
}
if (SettingsUtils.SettingsExists())
{
generalSettings = SettingsUtils.GetSettings<GeneralSettings>();
}
else
{
generalSettings = new GeneralSettings();
}
}
public PowerLauncherViewModel(PowerLauncherSettings settings, SendCallback callback)
{
this.settings = settings;
this.callback = callback;
}
private void UpdateSettings([CallerMemberName] string propertyName = null)
{
// Notify UI of property change
OnPropertyChanged(propertyName);
callback(settings);
}
public bool EnablePowerLauncher
{
get
{
return generalSettings.Enabled.PowerLauncher;
}
set
{
if (generalSettings.Enabled.PowerLauncher != value)
{
generalSettings.Enabled.PowerLauncher = value;
OnPropertyChanged(nameof(EnablePowerLauncher));
OutGoingGeneralSettings outgoing = new OutGoingGeneralSettings(generalSettings);
ShellPage.DefaultSndMSGCallback(outgoing.ToString());
}
}
}
public string SearchResultPreference
{
get
{
return settings.properties.search_result_preference;
}
set
{
if (settings.properties.search_result_preference != value)
{
settings.properties.search_result_preference = value;
UpdateSettings();
}
}
}
public string SearchTypePreference
{
get
{
return settings.properties.search_type_preference;
}
set
{
if (settings.properties.search_type_preference != value)
{
settings.properties.search_type_preference = value;
UpdateSettings();
}
}
}
public int MaximumNumberOfResults
{
get
{
return settings.properties.maximum_number_of_results;
}
set
{
if (settings.properties.maximum_number_of_results != value)
{
settings.properties.maximum_number_of_results = value;
UpdateSettings();
}
}
}
public HotkeySettings OpenPowerLauncher
{
get
{
return settings.properties.open_powerlauncher;
}
set
{
if (settings.properties.open_powerlauncher != value)
{
settings.properties.open_powerlauncher = value;
UpdateSettings();
}
}
}
public HotkeySettings OpenFileLocation
{
get
{
return settings.properties.open_file_location;
}
set
{
if (settings.properties.open_file_location != value)
{
settings.properties.open_file_location = value;
UpdateSettings();
}
}
}
public HotkeySettings CopyPathLocation
{
get
{
return settings.properties.copy_path_location;
}
set
{
if (settings.properties.copy_path_location != value)
{
settings.properties.copy_path_location = value;
UpdateSettings();
}
}
}
public HotkeySettings OpenConsole
{
callback = (PowerLauncherSettings settings) => callback = (PowerLauncherSettings settings) =>
{ {
// Propagate changes to Power Launcher through IPC // Propagate changes to Power Launcher through IPC

View File

@@ -1,4 +1,4 @@
<Page  <Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage" x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -9,6 +9,8 @@
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
mc:Ignorable="d" mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -17,7 +19,7 @@
<converters:StringFormatConverter x:Key="StringFormatConverter"/> <converters:StringFormatConverter x:Key="StringFormatConverter"/>
</Page.Resources> </Page.Resources>
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}"> <Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}" x:Name="MainView">
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutVisualStates"> <VisualStateGroup x:Name="LayoutVisualStates">
<VisualState x:Name="WideLayout"> <VisualState x:Name="WideLayout">
@@ -55,34 +57,49 @@
<TextBlock x:Uid="FancyZones_Description" <TextBlock x:Uid="FancyZones_Description"
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<ToggleSwitch x:Uid="FancyZones_EnableToggleControl_HeaderText" <ToggleSwitch x:Name="FancyZones_EnableToggleControl_HeaderText"
IsOn="{ Binding Mode=TwoWay, Path=IsEnabled}" x:Uid="FancyZones_EnableToggleControl_HeaderText"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"
Margin="{StaticResource MediumTopMargin}" /> Margin="{StaticResource MediumTopMargin}" />
<Button Margin="{StaticResource MediumTopMargin}" <Button Margin="{StaticResource MediumTopMargin}"
Style="{StaticResource AccentButtonStyle}" Style="{StaticResource AccentButtonStyle}"
Command = "{Binding LaunchEditorEventHandler, Source={StaticResource eventViewModel}}" Command = "{x:Bind ViewModel.LaunchEditorEventHandler}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Viewbox Height="12" Width="12"> <Viewbox Height="12" Width="12">
<PathIcon Data="M896 0v896H0V0h896zM768 768V128H128v640h640zM0 1920v-896h1920v896H0zm128-768v640h1664v-640H128zM1024 0h896v896h-896V0zm768 768V128h-640v640h640z"/> <PathIcon Data="M896 0v896H0V0h896zM768 768V128H128v640h640zM0 1920v-896h1920v896H0zm128-768v640h1664v-640H128zM1024 0h896v896h-896V0zm768 768V128h-640v640h640z"/>
</Viewbox> </Viewbox>
<TextBlock Margin="12,0,0,0" x:Uid="FancyZones_LaunchEditorButtonControl"/> <TextBlock Margin="12,0,0,0" x:Uid="FancyZones_LaunchEditorButtonControl"/>
</StackPanel> </StackPanel>
</Button> </Button>
<TextBlock x:Uid="FancyZones_ZoneBehavior_GroupSettings" <CustomControls:GroupTitleTextBlock
Style="{StaticResource SettingsGroupTitleStyle}" x:Uid="FancyZones_ZoneBehavior_GroupSettings"
/> IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/>
<StackPanel Orientation="Horizontal" Margin="{StaticResource SmallTopMargin}"> <StackPanel Orientation="Horizontal" Margin="{StaticResource SmallTopMargin}">
<TextBlock x:Uid="FancyZones_HotkeyEditorControl" <CustomControls:BodyTextBlock
Text="Editor Hotkeys"/> x:Uid="FancyZones_HotkeyEditorControl"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="5,-12,0,0"
/>
<Viewbox Height="14" Width="14" Margin="5,2,0,0" > <Viewbox Height="14" Width="14" Margin="5,2,0,0" >
<PathIcon <PathIcon
x:Name="FancyZones_HotkeyEditorControl_Icon"
x:Uid="FancyZones_HotkeyEditorControl_Icon" x:Uid="FancyZones_HotkeyEditorControl_Icon"
VerticalAlignment="Center" VerticalAlignment="Center"
Data="M960 1920q-133 0-255-34t-230-96-194-150-150-195-97-229T0 960q0-133 34-255t96-230 150-194 195-150 229-97T960 0q133 0 255 34t230 96 194 150 150 195 97 229 34 256q0 133-34 255t-96 230-150 194-195 150-229 97-256 34zm0-1792q-115 0-221 30t-198 84-169 130-130 168-84 199-30 221q0 114 30 220t84 199 130 169 168 130 199 84 221 30q114 0 220-30t199-84 169-130 130-168 84-199 30-221q0-114-30-220t-84-199-130-169-168-130-199-84-221-30zm-64 640h128v640H896V768zm0-256h128v128H896V512z"/> Data="M960 1920q-133 0-255-34t-230-96-194-150-150-195-97-229T0 960q0-133 34-255t96-230 150-194 195-150 229-97T960 0q133 0 255 34t230 96 194 150 150 195 97 229 34 256q0 133-34 255t-96 230-150 194-195 150-229 97-256 34zm0-1792q-115 0-221 30t-198 84-169 130-130 168-84 199-30 221q0 114 30 220t84 199 130 169 168 130 199 84 221 30q114 0 220-30t199-84 169-130 130-168 84-199 30-221q0-114-30-220t-84-199-130-169-168-130-199-84-221-30zm-64 640h128v640H896V768zm0-256h128v128H896V512z">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding IsOn, ElementName=FancyZones_EnableToggleControl_HeaderText}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=FancyZones_HotkeyEditorControl_Icon}" PropertyName="Foreground" Value="{ThemeResource SystemChromeDisabledLowColor}" />
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding IsOn, ElementName=FancyZones_EnableToggleControl_HeaderText}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=FancyZones_HotkeyEditorControl_Icon}" PropertyName="Foreground" Value="{ThemeResource SystemBaseHighColor}" />
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</PathIcon>
</Viewbox> </Viewbox>
</StackPanel> </StackPanel>
@@ -92,46 +109,46 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
Margin="0,5,0,0" Margin="0,5,0,0"
HotkeySettings="{x:Bind Path=ViewModel.EditorHotkey, Mode=TwoWay}" HotkeySettings="{x:Bind Path=ViewModel.EditorHotkey, Mode=TwoWay}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" Enabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<CheckBox x:Uid="FancyZones_ShiftDragCheckBoxControl_Header" <CheckBox x:Uid="FancyZones_ShiftDragCheckBoxControl_Header"
IsChecked="{ Binding Mode=TwoWay, Path=ShiftDrag}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ShiftDrag}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<CheckBox x:Uid="FancyZones_MouseDragCheckBoxControl_Header" <CheckBox x:Uid="FancyZones_MouseDragCheckBoxControl_Header"
IsChecked="{ Binding Mode=TwoWay, Path=MouseSwitch}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MouseSwitch}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<CheckBox x:Uid="FancyZones_OverrideSnapHotkeysCheckBoxControl" <CheckBox x:Uid="FancyZones_OverrideSnapHotkeysCheckBoxControl"
IsChecked="{ Binding Mode=TwoWay, Path=OverrideSnapHotkeys}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideSnapHotkeys}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_MoveWindowsAcrossAllMonitorsCheckBoxControl" <CheckBox x:Uid="FancyZones_MoveWindowsAcrossAllMonitorsCheckBoxControl"
IsChecked="{ Binding Mode=TwoWay, Path=MoveWindowsAcrossMonitors}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MoveWindowsAcrossMonitors}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_DisplayChangeMoveWindowsCheckBoxControl" <CheckBox x:Uid="FancyZones_DisplayChangeMoveWindowsCheckBoxControl"
IsChecked="{ Binding Mode=TwoWay, Path=DisplayChangeMoveWindows}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.DisplayChangeMoveWindows}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<CheckBox x:Uid="FancyZones_ZoneSetChangeMoveWindows" <CheckBox x:Uid="FancyZones_ZoneSetChangeMoveWindows"
IsChecked="{ Binding Mode=TwoWay, Path=ZoneSetChangeMoveWindows}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ZoneSetChangeMoveWindows}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_AppLastZoneMoveWindows" <CheckBox x:Uid="FancyZones_AppLastZoneMoveWindows"
IsChecked="{ Binding Mode=TwoWay, Path=AppLastZoneMoveWindows}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.AppLastZoneMoveWindows}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_OpenWindowOnActiveMonitor" <CheckBox x:Uid="FancyZones_OpenWindowOnActiveMonitor"
IsChecked="{ Binding Mode=TwoWay, Path=OpenWindowOnActiveMonitor}" IsChecked="{ Binding Mode=TwoWay, Path=OpenWindowOnActiveMonitor}"
@@ -139,57 +156,59 @@
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/>
<CheckBox x:Uid="FancyZones_RestoreSize" <CheckBox x:Uid="FancyZones_RestoreSize"
IsChecked="{ Binding Mode=TwoWay, Path=RestoreSize}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.RestoreSize}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_UseCursorPosEditorStartupScreen" <CheckBox x:Uid="FancyZones_UseCursorPosEditorStartupScreen"
IsChecked="{ Binding Mode=TwoWay, Path=UseCursorPosEditorStartupScreen}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.UseCursorPosEditorStartupScreen}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_ShowZonesOnAllMonitorsCheckBoxControl" <CheckBox x:Uid="FancyZones_ShowZonesOnAllMonitorsCheckBoxControl"
IsChecked="{ Binding Mode=TwoWay, Path=ShowOnAllMonitors}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ShowOnAllMonitors}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CheckBox x:Uid="FancyZones_MakeDraggedWindowTransparentCheckBoxControl" <CheckBox x:Uid="FancyZones_MakeDraggedWindowTransparentCheckBoxControl"
IsChecked="{ Binding Mode=TwoWay, Path=MakeDraggedWindowsTransparent}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.MakeDraggedWindowsTransparent}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<CustomControls:GroupTitleTextBlock x:Uid="Appearance_GroupSettings"
<TextBlock x:Uid="Appearance_GroupSettings" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Style="{StaticResource SettingsGroupTitleStyle}"/> />
<StackPanel Orientation="Horizontal" Margin="{StaticResource SmallTopMargin}" Spacing="12"> <StackPanel Orientation="Horizontal" Margin="{StaticResource SmallTopMargin}" Spacing="12">
<Slider x:Uid="FancyZones_HighlightOpacity" <Slider x:Uid="FancyZones_HighlightOpacity"
Minimum="0" Minimum="0"
Maximum="100" Maximum="100"
Width="240" Width="240"
IsThumbToolTipEnabled="False" IsThumbToolTipEnabled="False"
Value="{ Binding Mode=TwoWay, Path=HighlightOpacity}" Value="{x:Bind Mode=TwoWay, Path=ViewModel.HighlightOpacity}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<TextBlock Text="{ Binding Mode=OneWay, Path=HighlightOpacity, Converter={StaticResource StringFormatConverter}, ConverterParameter=' {0}%' }" <CustomControls:BodyTextBlock
VerticalAlignment="Center" Text="{x:Bind Mode=OneWay, Path=ViewModel.HighlightOpacity, Converter={StaticResource StringFormatConverter}, ConverterParameter=' {0}%' }"
FontSize="16" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="0,21,0,0"/> VerticalAlignment="Center"
FontSize="16"
Margin="0,21,0,0"/>
</StackPanel> </StackPanel>
<TextBlock x:Uid="FancyZones_ZoneHighlightColor"
Style="{StaticResource BodyTextBlockStyle}"
Margin="{StaticResource SmallTopMargin}" />
<muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" Padding="4,4,8,4"> <CustomControls:BodyTextBlock
x:Uid="FancyZones_ZoneHighlightColor"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" Padding="4,4,8,4">
<Border Width="48" CornerRadius="2" Height="24"> <Border Width="48" CornerRadius="2" Height="24">
<Border.Background> <Border.Background>
<SolidColorBrush Color="{Binding Path=ZoneHighlightColor, Mode=TwoWay}"/> <SolidColorBrush Color="{x:Bind Path=ViewModel.ZoneHighlightColor, Mode=TwoWay}"/>
</Border.Background> </Border.Background>
</Border> </Border>
<muxc:DropDownButton.Flyout> <muxc:DropDownButton.Flyout>
<Flyout> <Flyout>
<muxc:ColorPicker x:Name="FancyZones_ZoneHighlightColor" <muxc:ColorPicker x:Name="FancyZones_ZoneHighlightColor"
Margin="0,6,0,0" Margin="0,6,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsColorSliderVisible="True" IsColorSliderVisible="True"
@@ -198,22 +217,21 @@
IsAlphaEnabled="False" IsAlphaEnabled="False"
IsAlphaSliderVisible="False" IsAlphaSliderVisible="False"
IsAlphaTextInputVisible="False" IsAlphaTextInputVisible="False"
Color="{Binding Path=ZoneHighlightColor, Mode=TwoWay}" Color="{x:Bind Path=ViewModel.ZoneHighlightColor, Mode=TwoWay}"
/> />
</Flyout> </Flyout>
</muxc:DropDownButton.Flyout> </muxc:DropDownButton.Flyout>
</muxc:DropDownButton> </muxc:DropDownButton>
<TextBlock x:Uid="FancyZones_InActiveColor" <CustomControls:BodyTextBlock
Style="{StaticResource BodyTextBlockStyle}" x:Uid="FancyZones_InActiveColor"
Margin="{StaticResource SmallTopMargin}" /> IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" Padding="4,4,8,4"> <muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" Padding="4,4,8,4">
<Border Width="48" CornerRadius="2" Height="24"> <Border Width="48" CornerRadius="2" Height="24">
<Border.Background> <Border.Background>
<SolidColorBrush Color="{Binding Path=ZoneInActiveColor, Mode=TwoWay}"/> <SolidColorBrush Color="{x:Bind Path=ViewModel.ZoneInActiveColor, Mode=TwoWay}"/>
</Border.Background> </Border.Background>
</Border> </Border>
<muxc:DropDownButton.Flyout> <muxc:DropDownButton.Flyout>
@@ -227,21 +245,19 @@
IsAlphaEnabled="False" IsAlphaEnabled="False"
IsAlphaSliderVisible="False" IsAlphaSliderVisible="False"
IsAlphaTextInputVisible="False" IsAlphaTextInputVisible="False"
Color="{Binding Path=ZoneInActiveColor, Mode=TwoWay}"/> Color="{x:Bind Path=ViewModel.ZoneInActiveColor, Mode=TwoWay}"/>
</Flyout> </Flyout>
</muxc:DropDownButton.Flyout> </muxc:DropDownButton.Flyout>
</muxc:DropDownButton> </muxc:DropDownButton>
<TextBlock x:Uid="FancyZones_BorderColor"
Style="{StaticResource BodyTextBlockStyle}"
Margin="{StaticResource SmallTopMargin}" />
<CustomControls:BodyTextBlock
x:Uid="FancyZones_BorderColor"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" />
<muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" Padding="4,4,8,4"> <muxc:DropDownButton Margin="0,4,0,0" IsEnabled="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}" Padding="4,4,8,4">
<Border Width="48" CornerRadius="2" Height="24"> <Border Width="48" CornerRadius="2" Height="24">
<Border.Background> <Border.Background>
<SolidColorBrush Color="{Binding Path=ZoneBorderColor, Mode=TwoWay}"/> <SolidColorBrush Color="{x:Bind Path=ViewModel.ZoneBorderColor, Mode=TwoWay}"/>
</Border.Background> </Border.Background>
</Border> </Border>
<muxc:DropDownButton.Flyout> <muxc:DropDownButton.Flyout>
@@ -255,19 +271,21 @@
IsAlphaEnabled="False" IsAlphaEnabled="False"
IsAlphaSliderVisible="False" IsAlphaSliderVisible="False"
IsAlphaTextInputVisible="False" IsAlphaTextInputVisible="False"
Color="{Binding Path=ZoneBorderColor, Mode=TwoWay}" Color="{x:Bind Path=ViewModel.ZoneBorderColor, Mode=TwoWay}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"/>
</Flyout> </Flyout>
</muxc:DropDownButton.Flyout> </muxc:DropDownButton.Flyout>
</muxc:DropDownButton> </muxc:DropDownButton>
<TextBlock x:Uid="FancyZones_ExcludeApps" <CustomControls:GroupTitleTextBlock
Style="{StaticResource SettingsGroupTitleStyle}"/> x:Uid="FancyZones_ExcludeApps"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/>
<TextBox x:Uid="FancyZones_ExcludeApps_TextBoxControl" <TextBox x:Uid="FancyZones_ExcludeApps_TextBoxControl"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
Text="{ Binding Mode=TwoWay, Path=ExcludedApps}" Text="{x:Bind Mode=TwoWay, Path=ViewModel.ExcludedApps}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Width="380" Width="380"
Height="160" Height="160"
HorizontalAlignment="Left" HorizontalAlignment="Left"

View File

@@ -22,13 +22,13 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{ {
public sealed partial class FancyZonesPage : Page public sealed partial class FancyZonesPage : Page
{ {
public FancyZonesViewModel ViewModel { get; set; } private FancyZonesViewModel ViewModel { get; set; }
public FancyZonesPage() public FancyZonesPage()
{ {
this.InitializeComponent(); this.InitializeComponent();
ViewModel = new FancyZonesViewModel(); ViewModel = new FancyZonesViewModel();
this.FZSettingsView.DataContext = ViewModel; MainView.DataContext = ViewModel;
} }
} }
} }

View File

@@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels" xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:models="using:Microsoft.PowerToys.Settings.UI.Lib" xmlns:models="using:Microsoft.PowerToys.Settings.UI.Lib"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -50,20 +51,22 @@
<StackPanel Orientation="Vertical" x:Name="ImageResizerView"> <StackPanel Orientation="Vertical" x:Name="ImageResizerView">
<TextBlock x:Uid="ImageResizer_Description" <TextBlock x:Uid="ImageResizer_Description"
TextWrapping="Wrap"/> TextWrapping="Wrap"
/>
<ToggleSwitch x:Uid="ImageResizer_EnableToggle" <ToggleSwitch x:Uid="ImageResizer_EnableToggle"
Margin="{StaticResource MediumTopMargin}" Margin="{StaticResource MediumTopMargin}"
IsOn="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}"/> IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"/>
<TextBlock x:Uid="ImageResizer_CustomSizes" <CustomControls:GroupTitleTextBlock
Style="{StaticResource SettingsGroupTitleStyle}"/> x:Uid="ImageResizer_CustomSizes"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<ListView x:Name="ImagesSizesListView" <ListView x:Name="ImagesSizesListView"
ItemsSource="{Binding Sizes, Mode=TwoWay, Source={StaticResource ViewModel}}" ItemsSource="{Binding Sizes, Mode=TwoWay, Source={StaticResource ViewModel}}"
Padding="0" Padding="0"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="0" Margin="0"
SelectionMode="None"> SelectionMode="None">
@@ -171,21 +174,22 @@
x:Name="AddSizeButton" x:Name="AddSizeButton"
Width="560" Width="560"
Style="{StaticResource AddItemAppBarButtonStyle}" Style="{StaticResource AddItemAppBarButtonStyle}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}" IsEnabled="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"
x:Uid="ImageResizer_AddSizeButton" x:Uid="ImageResizer_AddSizeButton"
Margin="{StaticResource AddItemButtonMargin}" Margin="{StaticResource AddItemButtonMargin}"
Command = "{Binding AddImageSizeEventHandler, Source={StaticResource ViewModel}}" Command = "{Binding AddImageSizeEventHandler, Source={StaticResource ViewModel}}"
/> />
</StackPanel> </StackPanel>
<TextBlock Text="Encoding" <CustomControls:GroupTitleTextBlock
Style="{StaticResource SettingsGroupTitleStyle}"/> x:Uid="Encoding"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<ComboBox Header="Fallback encoder" <ComboBox x:Uid="ImageResizer_FallBackEncoderText"
SelectedIndex="{Binding Path=Encoder, Mode=TwoWay, Source={StaticResource ViewModel}}" SelectedIndex="{Binding Path=Encoder, Mode=TwoWay, Source={StaticResource ViewModel}}"
Width="240" Width="240"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}"> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_PNG" /> <ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_PNG" />
<ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_BMP" /> <ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_BMP" />
<ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_JPEG" /> <ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_JPEG" />
@@ -194,32 +198,32 @@
<ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_GIF" /> <ComboBoxItem x:Uid="ImageResizer_FallbackEncoder_GIF" />
</ComboBox> </ComboBox>
<CustomControls:BodyTextBlock x:Uid="ImageResizer_Encoding" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:NumberBox Header="JPEG Quality level" <muxc:NumberBox Minimum="0"
Minimum="0"
Maximum="100" Maximum="100"
Value="{ Binding Mode=TwoWay, Path=JPEGQualityLevel, Source={StaticResource ViewModel}}" Value="{ Binding Mode=TwoWay, Path=JPEGQualityLevel, Source={StaticResource ViewModel}}"
Width="240" Width="240"
Margin="{StaticResource HeaderTextTopMargin}"
SpinButtonPlacementMode="Compact" SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Margin="{StaticResource SmallTopMargin}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}"/> />
<ComboBox Header="PNG interlacing" <ComboBox x:Uid="ImageResizer_PNGInterlacing"
SelectedIndex="{ Binding Mode=TwoWay, Path=PngInterlaceOption, Source={StaticResource ViewModel}}" SelectedIndex="{ Binding Mode=TwoWay, Path=PngInterlaceOption, Source={StaticResource ViewModel}}"
Width="240" Width="240"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}"> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<ComboBoxItem x:Uid="Default"/> <ComboBoxItem x:Uid="Default"/>
<ComboBoxItem x:Uid="On"/> <ComboBoxItem x:Uid="On"/>
<ComboBoxItem x:Uid="Off"/> <ComboBoxItem x:Uid="Off"/>
</ComboBox> </ComboBox>
<ComboBox Header="TIFF Compression" <ComboBox x:Uid="ImageResizer_TIFFCompression"
SelectedIndex="{ Binding Mode=TwoWay, Path=TiffCompressOption, Source={StaticResource ViewModel}}" SelectedIndex="{ Binding Mode=TwoWay, Path=TiffCompressOption, Source={StaticResource ViewModel}}"
Width="240" Width="240"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}"> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_Default"/> <ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_Default"/>
<ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_None"/> <ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_None"/>
<ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_CCITT3"/> <ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_CCITT3"/>
@@ -229,44 +233,49 @@
<ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_Zip"/> <ComboBoxItem x:Uid="ImageResizer_ENCODER_TIFF_Zip"/>
</ComboBox> </ComboBox>
<TextBlock Text="File" Style="{StaticResource SettingsGroupTitleStyle}"/> <CustomControls:GroupTitleTextBlock x:Uid="File" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<TextBlock Text="The following parameters can be used:" Margin="{StaticResource SmallTopBottomMargin}"/> <CustomControls:BodyTextBlock x:Uid="ImageResizer_FileFormatDescription"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="{StaticResource SmallTopBottomMargin}"/>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%1</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%1" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Original filename</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Original filename" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%2</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%2" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Size name</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Size name" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%3</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%3" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Selected width</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Selected width" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%4</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%4" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Selected height</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Selected height" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%5</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%5" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Actual height</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Actual height" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBlock FontSize="12"> <StackPanel Orientation="Horizontal" Margin="0,-5,0,-5">
<Run FontWeight="Bold">%6</Run> <CustomControls:BodyTextBlock FontSize="12" FontWeight="Bold" Text="%6" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Run> - Actual width</Run> <CustomControls:BodyTextBlock FontSize="12" Text=" - Actual width" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</TextBlock> </StackPanel>
<TextBox Header="Filename format"
Text="{ Binding Mode=TwoWay, Path=FileName, Source={StaticResource ViewModel}}" <TextBox x:Uid="ImageResizer_FilenameFormatHeader"
Text="{x:Bind Mode=TwoWay, Path=ViewModel.FileName}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
MinWidth="240" MinWidth="240"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="{StaticResource SmallTopMargin}"/> Margin="{StaticResource SmallTopMargin}"
/>
<CheckBox Content="Use original date modified" <CheckBox x:Uid="ImageResizer_UseOriginalDate"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled, Source={StaticResource ViewModel}}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsChecked="{Binding Mode=TwoWay, Path=KeepDateModified, Source={StaticResource ViewModel}}"/> IsChecked="{Binding Mode=TwoWay, Path=KeepDateModified, Source={StaticResource ViewModel}}"/>
</StackPanel> </StackPanel>
@@ -293,8 +302,8 @@
<TextBlock <TextBlock
x:Uid="AttributionTitle" x:Uid="AttributionTitle"
Style="{StaticResource SettingsGroupTitleStyle}" /> Style="{StaticResource SettingsGroupTitleStyle}"/>
<HyperlinkButton <HyperlinkButton
NavigateUri="https://github.com/bricelam/ImageResizer/"> NavigateUri="https://github.com/bricelam/ImageResizer/">
<TextBlock Text="Brice Lambson's ImageResizer" TextWrapping="Wrap" /> <TextBlock Text="Brice Lambson's ImageResizer" TextWrapping="Wrap" />

View File

@@ -9,12 +9,14 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{ {
public sealed partial class ImageResizerPage : Page public sealed partial class ImageResizerPage : Page
{ {
public ImageResizerViewModel ViewModel { get; set; } ImageResizerViewModel ViewModel { get; set; }
public ImageResizerPage() public ImageResizerPage()
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new ImageResizerViewModel(); ViewModel = new ImageResizerViewModel();
DataContext = ViewModel;
} }
} }
} }

View File

@@ -1,332 +1,336 @@
<Page <Page
x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage" x:Class="Microsoft.PowerToys.Settings.UI.Views.KeyboardManagerPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views" xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels" xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions" xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Lib" xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
mc:Ignorable="d" xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Lib"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Page.Resources>
<viewModel:KeyboardManagerViewModel x:Key="eventViewModel"/> <Page.Resources>
<local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" /> <viewModel:KeyboardManagerViewModel x:Key="eventViewModel"/>
<DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel"> <local:VisibleIfNotEmpty x:Key="visibleIfNotEmptyConverter" />
<StackPanel <DataTemplate x:Name="KeysListViewTemplate" x:DataType="Lib:KeysDataModel">
Orientation="Horizontal" <StackPanel
Height="56"> Orientation="Horizontal"
<ItemsControl Height="56">
ItemsSource="{x:Bind GetOriginalKeys()}"> <ItemsControl
<ItemsControl.ItemsPanel> ItemsSource="{x:Bind GetOriginalKeys()}">
<ItemsPanelTemplate> <ItemsControl.ItemsPanel>
<StackPanel Orientation="Horizontal"/> <ItemsPanelTemplate>
</ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/>
</ItemsControl.ItemsPanel> </ItemsPanelTemplate>
<ItemsControl.ItemTemplate> </ItemsControl.ItemsPanel>
<DataTemplate> <ItemsControl.ItemTemplate>
<Border <DataTemplate>
Background="{ThemeResource SystemBaseLowColor}" <Border
CornerRadius="4" Background="{ThemeResource SystemBaseLowColor}"
Padding="14,0,14,0" CornerRadius="4"
Margin="5,0,5,0" Padding="14,0,14,0"
Height="36" Margin="5,0,5,0"
VerticalAlignment="Center" Height="36"
HorizontalAlignment="Left"> VerticalAlignment="Center"
<TextBlock HorizontalAlignment="Left">
FontWeight="SemiBold" <TextBlock
VerticalAlignment="Center" FontWeight="SemiBold"
TextAlignment="Center" VerticalAlignment="Center"
FontSize="12" TextAlignment="Center"
Text="{Binding}" /> FontSize="12"
</Border> Text="{Binding}" />
</DataTemplate> </Border>
</ItemsControl.ItemTemplate> </DataTemplate>
</ItemsControl> </ItemsControl.ItemTemplate>
<FontIcon Glyph="&#xE72A;" </ItemsControl>
Grid.Column="1" <FontIcon Glyph="&#xE72A;"
FontSize="14" Grid.Column="1"
VerticalAlignment="Center" FontSize="14"
Margin="5,0,5,0"/> VerticalAlignment="Center"
<ItemsControl Margin="5,0,5,0"/>
ItemsSource="{x:Bind GetNewRemapKeys()}" <ItemsControl
Grid.Column="2"> ItemsSource="{x:Bind GetNewRemapKeys()}"
<ItemsControl.ItemsPanel> Grid.Column="2">
<ItemsPanelTemplate> <ItemsControl.ItemsPanel>
<StackPanel Orientation="Horizontal"/> <ItemsPanelTemplate>
</ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/>
</ItemsControl.ItemsPanel> </ItemsPanelTemplate>
<ItemsControl.ItemTemplate> </ItemsControl.ItemsPanel>
<DataTemplate> <ItemsControl.ItemTemplate>
<Border <DataTemplate>
Background="{ThemeResource SystemAccentColor}" <Border
CornerRadius="4" Background="{ThemeResource SystemAccentColor}"
Padding="14,0,14,0" CornerRadius="4"
Margin="5,0,5,0" Padding="14,0,14,0"
Height="36" Margin="5,0,5,0"
VerticalAlignment="Center" Height="36"
HorizontalAlignment="Left"> VerticalAlignment="Center"
<TextBlock HorizontalAlignment="Left">
FontWeight="SemiBold" <TextBlock
VerticalAlignment="Center" FontWeight="SemiBold"
TextAlignment="Center" VerticalAlignment="Center"
Foreground="White" TextAlignment="Center"
FontSize="12" Foreground="White"
Text="{Binding}" /> FontSize="12"
</Border> Text="{Binding}" />
</DataTemplate> </Border>
</ItemsControl.ItemTemplate> </DataTemplate>
</ItemsControl> </ItemsControl.ItemTemplate>
</StackPanel> </ItemsControl>
</DataTemplate> </StackPanel>
<DataTemplate x:Name="ShortcutKeysListViewTemplate" x:DataType="Lib:AppSpecificKeysDataModel"> </DataTemplate>
<StackPanel <DataTemplate x:Name="ShortcutKeysListViewTemplate" x:DataType="Lib:AppSpecificKeysDataModel">
Orientation="Horizontal" <StackPanel
Height="56"> Orientation="Horizontal"
<ItemsControl Height="56">
ItemsSource="{x:Bind GetOriginalKeys()}"> <ItemsControl
<ItemsControl.ItemsPanel> ItemsSource="{x:Bind GetOriginalKeys()}">
<ItemsPanelTemplate> <ItemsControl.ItemsPanel>
<StackPanel Orientation="Horizontal"/> <ItemsPanelTemplate>
</ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/>
</ItemsControl.ItemsPanel> </ItemsPanelTemplate>
<ItemsControl.ItemTemplate> </ItemsControl.ItemsPanel>
<DataTemplate> <ItemsControl.ItemTemplate>
<Border <DataTemplate>
Background="{ThemeResource SystemBaseLowColor}" <Border
CornerRadius="4" Background="{ThemeResource SystemBaseLowColor}"
Padding="14,0,14,0" CornerRadius="4"
Margin="5,0,5,0" Padding="14,0,14,0"
Height="36" Margin="5,0,5,0"
VerticalAlignment="Center" Height="36"
HorizontalAlignment="Left"> VerticalAlignment="Center"
<TextBlock HorizontalAlignment="Left">
FontWeight="SemiBold" <TextBlock
VerticalAlignment="Center" FontWeight="SemiBold"
TextAlignment="Center" VerticalAlignment="Center"
FontSize="12" TextAlignment="Center"
Text="{Binding}" /> FontSize="12"
</Border> Text="{Binding}" />
</DataTemplate> </Border>
</ItemsControl.ItemTemplate> </DataTemplate>
</ItemsControl> </ItemsControl.ItemTemplate>
<FontIcon Glyph="&#xE72A;" </ItemsControl>
Grid.Column="1" <FontIcon Glyph="&#xE72A;"
FontSize="14" Grid.Column="1"
VerticalAlignment="Center" FontSize="14"
Margin="5,0,5,0"/> VerticalAlignment="Center"
<ItemsControl Margin="5,0,5,0"/>
ItemsSource="{x:Bind GetNewRemapKeys()}" <ItemsControl
Grid.Column="2"> ItemsSource="{x:Bind GetNewRemapKeys()}"
<ItemsControl.ItemsPanel> Grid.Column="2">
<ItemsPanelTemplate> <ItemsControl.ItemsPanel>
<StackPanel Orientation="Horizontal"/> <ItemsPanelTemplate>
</ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/>
</ItemsControl.ItemsPanel> </ItemsPanelTemplate>
<ItemsControl.ItemTemplate> </ItemsControl.ItemsPanel>
<DataTemplate> <ItemsControl.ItemTemplate>
<Border <DataTemplate>
Background="{ThemeResource SystemAccentColor}" <Border
CornerRadius="4" Background="{ThemeResource SystemAccentColor}"
Padding="14,0,14,0" CornerRadius="4"
Margin="5,0,5,0" Padding="14,0,14,0"
Height="36" Margin="5,0,5,0"
VerticalAlignment="Center" Height="36"
HorizontalAlignment="Left"> VerticalAlignment="Center"
<TextBlock HorizontalAlignment="Left">
FontWeight="SemiBold" <TextBlock
VerticalAlignment="Center" FontWeight="SemiBold"
TextAlignment="Center" VerticalAlignment="Center"
Foreground="White" TextAlignment="Center"
FontSize="12" Foreground="White"
Text="{Binding}" /> FontSize="12"
</Border> Text="{Binding}" />
</DataTemplate> </Border>
</ItemsControl.ItemTemplate> </DataTemplate>
</ItemsControl> </ItemsControl.ItemTemplate>
<FontIcon Glyph="&#xE72A;" </ItemsControl>
Grid.Column="3" <FontIcon Glyph="&#xE72A;"
FontSize="14" Grid.Column="3"
VerticalAlignment="Center" FontSize="14"
Margin="5,0,5,0"/> VerticalAlignment="Center"
<Border Margin="5,0,5,0"/>
Background="{ThemeResource SystemAccentColor}" <Border
Grid.Column="4" Background="{ThemeResource SystemAccentColor}"
CornerRadius="4" Grid.Column="4"
Padding="14,0,14,0" CornerRadius="4"
Margin="5,0,5,0" Padding="14,0,14,0"
Height="36" Margin="5,0,5,0"
VerticalAlignment="Center" Height="36"
HorizontalAlignment="Left"> VerticalAlignment="Center"
<TextBlock HorizontalAlignment="Left">
FontWeight="SemiBold" <TextBlock
VerticalAlignment="Center" FontWeight="SemiBold"
TextAlignment="Center" VerticalAlignment="Center"
Foreground="White" TextAlignment="Center"
FontSize="12" Foreground="White"
Text="{x:Bind TargetApp}" /> FontSize="12"
</Border> Text="{x:Bind TargetApp}" />
</StackPanel> </Border>
</DataTemplate> </StackPanel>
</Page.Resources> </DataTemplate>
</Page.Resources>
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateManager.VisualStateGroups> <Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateGroup x:Name="LayoutVisualStates"> <VisualStateManager.VisualStateGroups>
<VisualState x:Name="WideLayout"> <VisualStateGroup x:Name="LayoutVisualStates">
<VisualState.StateTriggers> <VisualState x:Name="WideLayout">
<AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" /> <VisualState.StateTriggers>
</VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" />
<VisualState.Setters> </VisualState.StateTriggers>
<Setter Target="SidePanel.(Grid.Column)" Value="1" /> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Row)" Value="0" /> <Setter Target="SidePanel.(Grid.Column)" Value="1" />
<Setter Target="SidePanel.Width" Value="{StaticResource SidePanelWidth}" /> <Setter Target="SidePanel.(Grid.Row)" Value="0" />
</VisualState.Setters> <Setter Target="SidePanel.Width" Value="{StaticResource SidePanelWidth}" />
</VisualState> </VisualState.Setters>
<VisualState x:Name="SmallLayout"> </VisualState>
<VisualState.StateTriggers> <VisualState x:Name="SmallLayout">
<AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" /> <VisualState.StateTriggers>
</VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" />
<VisualState.Setters> </VisualState.StateTriggers>
<Setter Target="SidePanel.(Grid.Column)" Value="0" /> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Row)" Value="1" /> <Setter Target="SidePanel.(Grid.Column)" Value="0" />
<Setter Target="SidePanel.Width" Value="Auto" /> <Setter Target="SidePanel.(Grid.Row)" Value="1" />
</VisualState.Setters> <Setter Target="SidePanel.Width" Value="Auto" />
</VisualState> </VisualState.Setters>
</VisualStateGroup> </VisualState>
</VisualStateManager.VisualStateGroups> </VisualStateGroup>
<Grid.ColumnDefinitions> </VisualStateManager.VisualStateGroups>
<ColumnDefinition Width="*"/> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/>
<Grid.RowDefinitions> </Grid.ColumnDefinitions>
<RowDefinition Height="Auto"/> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="KeyboardManager_Description" <StackPanel Orientation="Vertical">
TextWrapping="Wrap"/> <TextBlock x:Uid="KeyboardManager_Description"
TextWrapping="Wrap"/>
<ToggleSwitch x:Uid="KeyboardManager_EnableToggle"
IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}" <ToggleSwitch x:Uid="KeyboardManager_EnableToggle"
Margin="{StaticResource MediumTopMargin}" /> IsOn="{x:Bind Path=ViewModel.Enabled, Mode=TwoWay}"
Margin="{StaticResource MediumTopMargin}" />
<!--<TextBlock x:Uid="KeyboardManager_ConfigHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/> <!--<TextBlock x:Uid="KeyboardManager_ConfigHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/>
<TextBlock x:Uid="KeyboardManager_ProfileDescription"
Margin="{StaticResource SmallTopMargin}"/> <TextBlock x:Uid="KeyboardManager_ProfileDescription"
Margin="{StaticResource SmallTopMargin}"/>
<ComboBox SelectedIndex="1" MinWidth="160"
Margin="{StaticResource SmallTopMargin}"> <ComboBox SelectedIndex="1" MinWidth="160"
<ComboBoxItem Content="Config-1"/> Margin="{StaticResource SmallTopMargin}">
<ComboBoxItem Content="Config-2"/> <ComboBoxItem Content="Config-1"/>
<ComboBoxItem Content="Config-3"/> <ComboBoxItem Content="Config-2"/>
</ComboBox>--> <ComboBoxItem Content="Config-3"/>
</ComboBox>-->
<TextBlock x:Uid="KeyboardManager_RemapKeyboardHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/> <CustomControls:GroupTitleTextBlock x:Uid="KeyboardManager_RemapKeyboardHeader"
IsActive="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
<TextBlock Text="Click below to remap a single key to another key"
Margin="{StaticResource SmallTopMargin}" <CustomControls:BodyTextBlock Text="Click below to remap a single key to another key"
TextWrapping="Wrap"/> IsActive="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
Margin="{StaticResource SmallTopMargin}"/>
<Button x:Uid="KeyboardManager_RemapKeyboardButton"
Margin="{StaticResource SmallTopMargin}" <Button x:Uid="KeyboardManager_RemapKeyboardButton"
Style="{StaticResource AccentButtonStyle}" Margin="{StaticResource SmallTopMargin}"
Command="{Binding Path=RemapKeyboardCommand}" Style="{StaticResource AccentButtonStyle}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/> Command="{Binding Path=RemapKeyboardCommand}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
<ListView x:Name="RemapKeysList"
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}" <ListView x:Name="RemapKeysList"
ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}" extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
ItemTemplate="{StaticResource KeysListViewTemplate}" ItemsSource="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay}"
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" ItemTemplate="{StaticResource KeysListViewTemplate}"
BorderThickness="1" BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
CornerRadius="4" BorderThickness="1"
MinWidth="350" CornerRadius="4"
MaxHeight="200" MinWidth="350"
Margin="{StaticResource SmallTopBottomMargin}" MaxHeight="200"
HorizontalAlignment="Left" Margin="{StaticResource SmallTopBottomMargin}"
SelectionMode="None" HorizontalAlignment="Left"
IsSwipeEnabled="False" SelectionMode="None"
Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}" IsSwipeEnabled="False"
/> Visibility="{x:Bind Path=ViewModel.RemapKeys, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
<!--<AppBarButton x:Uid="KeyboardManager_RemapKeyboardButton" />
Icon="Add"
Width="370" <!--<AppBarButton x:Uid="KeyboardManager_RemapKeyboardButton"
Style="{StaticResource AddItemAppBarButtonStyle}" Icon="Add"
Command="{Binding Path=RemapKeyboardCommand}" Width="370"
Margin="{StaticResource AddItemButtonMargin}" Style="{StaticResource AddItemAppBarButtonStyle}"
HorizontalAlignment="Left" Command="{Binding Path=RemapKeyboardCommand}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>--> Margin="{StaticResource AddItemButtonMargin}"
HorizontalAlignment="Left"
<TextBlock x:Uid="KeyboardManager_RemapShortcutsHeader" IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>-->
Style="{StaticResource SettingsGroupTitleStyle}"/>
<CustomControls:GroupTitleTextBlock x:Uid="KeyboardManager_RemapShortcutsHeader"
<TextBlock Text="Click below to remap a shortcut (hotkey) to another shortcut" IsActive="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
TextWrapping="Wrap" Margin="{StaticResource SmallTopMargin}"/>
<CustomControls:BodyTextBlock Text="Click below to remap a shortcut (hotkey) to another shortcut"
<Button x:Uid="KeyboardManager_RemapShortcutsButton" IsActive="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"/>
Margin="{StaticResource SmallTopMargin}"
Style="{StaticResource AccentButtonStyle}" <Button x:Uid="KeyboardManager_RemapShortcutsButton"
Command="{Binding Path=EditShortcutCommand}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}" Style="{StaticResource AccentButtonStyle}"
/> Command="{Binding Path=EditShortcutCommand}"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
<ListView x:Name="RemapShortcutsList" />
extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}" <ListView x:Name="RemapShortcutsList"
ItemTemplate="{StaticResource ShortcutKeysListViewTemplate}" extensions:ListViewExtensions.AlternateColor="{ThemeResource SystemControlBackgroundListLowBrush}"
BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}" ItemsSource="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay}"
BorderThickness="1" ItemTemplate="{StaticResource ShortcutKeysListViewTemplate}"
CornerRadius="4" BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"
MinWidth="350" BorderThickness="1"
MaxHeight="200" CornerRadius="4"
Margin="{StaticResource SmallTopBottomMargin}" MinWidth="350"
HorizontalAlignment="Left" MaxHeight="200"
SelectionMode="None" Margin="{StaticResource SmallTopBottomMargin}"
IsSwipeEnabled="False" HorizontalAlignment="Left"
Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}" SelectionMode="None"
ScrollViewer.HorizontalScrollMode="Enabled" IsSwipeEnabled="False"
ScrollViewer.HorizontalScrollBarVisibility="Visible" Visibility="{x:Bind Path=ViewModel.RemapShortcuts, Mode=OneWay, Converter={StaticResource visibleIfNotEmptyConverter}}"
ScrollViewer.IsHorizontalRailEnabled="True" IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
/> ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
<!--<AppBarButton x:Uid="KeyboardManager_RemapShortcutsButton" ScrollViewer.IsHorizontalRailEnabled="True"
Icon="Add" />
Width="370"
Style="{StaticResource AddItemAppBarButtonStyle}" <!--<AppBarButton x:Uid="KeyboardManager_RemapShortcutsButton"
Command="{Binding Path=EditShortcutCommand}" Icon="Add"
IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}" Width="370"
Margin="{StaticResource AddItemButtonMargin}" Style="{StaticResource AddItemAppBarButtonStyle}"
HorizontalAlignment="Left" Command="{Binding Path=EditShortcutCommand}"
/>--> IsEnabled="{x:Bind Path=ViewModel.Enabled, Mode=OneWay}"
</StackPanel> Margin="{StaticResource AddItemButtonMargin}"
HorizontalAlignment="Left"
<StackPanel />-->
x:Name="SidePanel" </StackPanel>
Orientation="Vertical"
HorizontalAlignment="Left" <StackPanel
Width="{StaticResource SidePanelWidth}" x:Name="SidePanel"
Grid.Column="1"> Orientation="Vertical"
HorizontalAlignment="Left"
<TextBlock Width="{StaticResource SidePanelWidth}"
x:Uid="About_KeyboardManager" Grid.Column="1">
Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"/> <TextBlock
x:Uid="About_KeyboardManager"
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_KeyboardManager"> Style="{StaticResource SettingsGroupTitleStyle}"
<TextBlock x:Uid="Module_overview" /> Margin="{StaticResource XSmallBottomMargin}"
</HyperlinkButton> Foreground="{Binding Mode=TwoWay, Path=TextColor}"/>
<HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues"> <HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_KeyboardManager">
<TextBlock x:Uid="Give_Feedback" /> <TextBlock x:Uid="Module_overview" />
</HyperlinkButton> </HyperlinkButton>
</StackPanel>
</Grid> <HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues">
</Page> <TextBlock x:Uid="Give_Feedback" />
</HyperlinkButton>
</StackPanel>
</Grid>
</Page>

View File

@@ -1,177 +1,180 @@
<Page <Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views" xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:Custom="using:Microsoft.PowerToys.Settings.UI.Controls" x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerLauncherPage"
x:Class="Microsoft.PowerToys.Settings.UI.Views.PowerLauncherPage" xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
mc:Ignorable="d" xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateManager.VisualStateGroups> <Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateGroup x:Name="LayoutVisualStates"> <VisualStateManager.VisualStateGroups>
<VisualState x:Name="WideLayout"> <VisualStateGroup x:Name="LayoutVisualStates">
<VisualState.StateTriggers> <VisualState x:Name="WideLayout">
<AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" /> <VisualState.StateTriggers>
</VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="{StaticResource WideLayoutMinWidth}" />
<VisualState.Setters> </VisualState.StateTriggers>
<Setter Target="SidePanel.(Grid.Column)" Value="1" /> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Row)" Value="0" /> <Setter Target="SidePanel.(Grid.Column)" Value="1" />
<Setter Target="SidePanel.Width" Value="{StaticResource SidePanelWidth}" /> <Setter Target="SidePanel.(Grid.Row)" Value="0" />
</VisualState.Setters> <Setter Target="SidePanel.Width" Value="{StaticResource SidePanelWidth}" />
</VisualState> </VisualState.Setters>
<VisualState x:Name="SmallLayout"> </VisualState>
<VisualState.StateTriggers> <VisualState x:Name="SmallLayout">
<AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" /> <VisualState.StateTriggers>
</VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="{StaticResource SmallLayoutMinWidth}" />
<VisualState.Setters> </VisualState.StateTriggers>
<Setter Target="SidePanel.(Grid.Column)" Value="0" /> <VisualState.Setters>
<Setter Target="SidePanel.(Grid.Row)" Value="1" /> <Setter Target="SidePanel.(Grid.Column)" Value="0" />
<Setter Target="SidePanel.Width" Value="Auto" /> <Setter Target="SidePanel.(Grid.Row)" Value="1" />
</VisualState.Setters> <Setter Target="SidePanel.Width" Value="Auto" />
</VisualState> </VisualState.Setters>
</VisualStateGroup> </VisualState>
</VisualStateManager.VisualStateGroups> </VisualStateGroup>
<Grid.ColumnDefinitions> </VisualStateManager.VisualStateGroups>
<ColumnDefinition Width="*"/> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/>
<Grid.RowDefinitions> </Grid.ColumnDefinitions>
<RowDefinition Height="Auto"/> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/>
</Grid.RowDefinitions> <RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical">
<TextBlock x:Uid="PowerLauncher_Description" <StackPanel Orientation="Vertical">
TextWrapping="Wrap"/> <TextBlock x:Uid="PowerLauncher_Description"
TextWrapping="Wrap"/>
<ToggleSwitch x:Uid="PowerLauncher_EnablePowerLauncher"
IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.EnablePowerLauncher}" <ToggleSwitch x:Uid="PowerLauncher_EnablePowerLauncher"
Margin="{StaticResource MediumTopMargin}"/> IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.EnablePowerLauncher}"
Margin="{StaticResource MediumTopMargin}"/>
<TextBlock x:Uid="PowerLauncher_SearchResults"
Style="{StaticResource SettingsGroupTitleStyle}"/> <CustomControls:GroupTitleTextBlock x:Uid="PowerLauncher_SearchResults"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/>
<!--<ComboBox x:Uid="PowerLauncher_SearchResultPreference"
MinWidth="320" <!--<ComboBox x:Uid="PowerLauncher_SearchResultPreference"
Margin="{StaticResource SmallTopMargin}" MinWidth="320"
ItemsSource="{x:Bind searchResultPreferencesOptions}" Margin="{StaticResource SmallTopMargin}"
SelectedItem="{x:Bind Mode=TwoWay, Path=SelectedSearchResultPreference}" ItemsSource="{Binding searchResultPreferencesOptions}"
SelectedValuePath="Item2" SelectedItem="{Binding Mode=TwoWay, Path=SelectedSearchResultPreference}"
DisplayMemberPath="Item1" SelectedValuePath="Item2"
IsEnabled="False" DisplayMemberPath="Item1"
/> IsEnabled="False"
/>
<ComboBox x:Uid="PowerLauncher_SearchTypePreference"
MinWidth="320" <ComboBox x:Uid="PowerLauncher_SearchTypePreference"
Margin="{StaticResource SmallTopMargin}" MinWidth="320"
ItemsSource="{x:Bind searchTypePreferencesOptions}" Margin="{StaticResource SmallTopMargin}"
SelectedItem="{x:Bind Mode=TwoWay, Path=SelectedSearchTypePreference}" ItemsSource="{Binding searchTypePreferencesOptions}"
SelectedValuePath="Item2" SelectedItem="{Binding Mode=TwoWay, Path=SelectedSearchTypePreference}"
DisplayMemberPath="Item1" SelectedValuePath="Item2"
IsEnabled="False" DisplayMemberPath="Item1"
/>--> IsEnabled="False"
/>-->
<muxc:NumberBox x:Uid="PowerLauncher_MaximumNumberOfResults"
Value="{x:Bind Mode=TwoWay, Path=ViewModel.MaximumNumberOfResults}" <CustomControls:BodyTextBlock x:Uid="PowerLauncher_MaximumNumberOfResults"
Width="240" Margin="{StaticResource SmallTopMargin}"
SpinButtonPlacementMode="Compact" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/>
HorizontalAlignment="Left" <muxc:NumberBox Value="{Binding Mode=TwoWay, Path=MaximumNumberOfResults}"
Margin="{StaticResource SmallTopMargin}" Width="240"
Minimum="1" SpinButtonPlacementMode="Compact"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/> HorizontalAlignment="Left"
Minimum="1"
<TextBlock x:Uid="PowerLauncher_Shortcuts" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/>
HorizontalAlignment="Left"
Style="{StaticResource SettingsGroupTitleStyle}"/> <CustomControls:GroupTitleTextBlock x:Uid="PowerLauncher_Shortcuts"
HorizontalAlignment="Left"
<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenPowerLauncher" IsActive="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/>
Width="240"
HorizontalAlignment="Left" <CustomControls:HotkeySettingsControl x:Uid="PowerLauncher_OpenPowerLauncher"
Margin="{StaticResource SmallTopMargin}" Width="240"
HotkeySettings="{x:Bind Path=ViewModel.OpenPowerLauncher, Mode=TwoWay}" HorizontalAlignment="Left"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}" Margin="{StaticResource SmallTopMargin}"
/> HotkeySettings="{x:Bind Path=ViewModel.OpenPowerLauncher, Mode=TwoWay}"
<!--<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenFileLocation" Enabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"/>
Width="320" <!--<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenFileLocation"
HorizontalAlignment="Left" Width="320"
Margin="{StaticResource SmallTopMargin}" HorizontalAlignment="Left"
HotkeySettings="{x:Bind Path=ViewModel.OpenFileLocation, Mode=TwoWay}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="False" HotkeySettings="{Binding Path=ViewModel.OpenFileLocation, Mode=TwoWay}"
/> IsEnabled="False"
<Custom:HotkeySettingsControl x:Uid="PowerLauncher_CopyPathLocation" />
Width="320" <Custom:HotkeySettingsControl x:Uid="PowerLauncher_CopyPathLocation"
HorizontalAlignment="Left" Width="320"
Margin="{StaticResource SmallTopMargin}" HorizontalAlignment="Left"
HotkeySettings="{x:Bind Path=ViewModel.CopyPathLocation, Mode=TwoWay}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="False" HotkeySettings="{Binding Path=ViewModel.CopyPathLocation, Mode=TwoWay}"
/> IsEnabled="False"
<Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenConsole" />
Width="320" <Custom:HotkeySettingsControl x:Uid="PowerLauncher_OpenConsole"
HorizontalAlignment="Left" Width="320"
Margin="{StaticResource SmallTopMargin}" HorizontalAlignment="Left"
HotkeySettings="{x:Bind Path=ViewModel.OpenConsole, Mode=TwoWay}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="False" HotkeySettings="{Binding Path=ViewModel.OpenConsole, Mode=TwoWay}"
/>--> IsEnabled="False"
/>-->
<!--<CheckBox x:Uid="PowerLauncher_OverrideWinRKey"
Margin="{StaticResource SmallTopMargin}" <!--<CheckBox x:Uid="PowerLauncher_OverrideWinRKey"
IsChecked="False" Margin="{StaticResource SmallTopMargin}"
IsEnabled="False" IsChecked="False"
/>--> IsEnabled="False"
/>-->
<!--<CheckBox x:Uid="PowerLauncher_OverrideWinSKey"
Margin="{StaticResource SmallTopMargin}" <!--<CheckBox x:Uid="PowerLauncher_OverrideWinSKey"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.OverrideWinSKey}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="False" IsChecked="{Binding Mode=TwoWay, Path=ViewModel.OverrideWinSKey}"
/>--> IsEnabled="False"
/>-->
<CheckBox x:Uid="PowerLauncher_IgnoreHotkeysInFullScreen"
Margin="{StaticResource SmallTopMargin}" <CheckBox x:Uid="PowerLauncher_IgnoreHotkeysInFullScreen"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.IgnoreHotkeysInFullScreen}"
/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
/>
<CheckBox x:Uid="PowerLauncher_ClearInputOnLaunch"
Margin="{StaticResource SmallTopMargin}" <CheckBox x:Uid="PowerLauncher_ClearInputOnLaunch"
IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ClearInputOnLaunch}" Margin="{StaticResource SmallTopMargin}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}" IsChecked="{x:Bind Mode=TwoWay, Path=ViewModel.ClearInputOnLaunch}"
/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.EnablePowerLauncher}"
</StackPanel> />
<StackPanel </StackPanel>
x:Name="SidePanel" <StackPanel
Orientation="Vertical" x:Name="SidePanel"
HorizontalAlignment="Left" Orientation="Vertical"
Width="{StaticResource SidePanelWidth}" HorizontalAlignment="Left"
Grid.Column="1"> Width="{StaticResource SidePanelWidth}"
Grid.Column="1">
<TextBlock
x:Uid="About_PowerLauncher" <TextBlock
Style="{StaticResource SettingsGroupTitleStyle}" x:Uid="About_PowerLauncher"
Margin="{StaticResource XSmallBottomMargin}"/> Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerToysRun"> Foreground="{ Binding Mode=TwoWay, Path=TextColor}"/>
<TextBlock x:Uid="Module_overview" />
</HyperlinkButton> <HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerToysRun">
<TextBlock x:Uid="Module_overview" />
<HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues"> </HyperlinkButton>
<TextBlock x:Uid="Give_Feedback" />
</HyperlinkButton> <HyperlinkButton NavigateUri="https://github.com/microsoft/PowerToys/issues">
<TextBlock x:Uid="Give_Feedback" />
<TextBlock </HyperlinkButton>
x:Uid="AttributionTitle"
Style="{StaticResource SettingsGroupTitleStyle}" /> <TextBlock
x:Uid="AttributionTitle"
<HyperlinkButton NavigateUri="https://github.com/Wox-launcher/Wox/"> Style="{StaticResource SettingsGroupTitleStyle}"
<TextBlock Text="Wox"/> Foreground="{ Binding Mode=TwoWay, Path=TextColor}"/>
</HyperlinkButton>
<HyperlinkButton NavigateUri="https://github.com/Wox-launcher/Wox/">
<HyperlinkButton NavigateUri="https://github.com/betsegaw/windowwalker/"> <TextBlock Text="Wox"/>
<TextBlock Text="Beta Tadele's Window Walker" /> </HyperlinkButton>
</HyperlinkButton>
</StackPanel> <HyperlinkButton NavigateUri="https://github.com/betsegaw/windowwalker/">
</Grid> <TextBlock Text="Beta Tadele's Window Walker" />
</HyperlinkButton>
</StackPanel>
</Grid>
</Page> </Page>

View File

@@ -11,7 +11,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{ {
public sealed partial class PowerLauncherPage : Page public sealed partial class PowerLauncherPage : Page
{ {
public PowerLauncherViewModel ViewModel { get; } = new PowerLauncherViewModel(); public PowerLauncherViewModel ViewModel { get; set; }
private readonly ObservableCollection<Tuple<string, string>> searchResultPreferencesOptions; private readonly ObservableCollection<Tuple<string, string>> searchResultPreferencesOptions;
private readonly ObservableCollection<Tuple<string, string>> searchTypePreferencesOptions; private readonly ObservableCollection<Tuple<string, string>> searchTypePreferencesOptions;
@@ -19,6 +19,8 @@ namespace Microsoft.PowerToys.Settings.UI.Views
public PowerLauncherPage() public PowerLauncherPage()
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new PowerLauncherViewModel();
DataContext = ViewModel;
var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView(); var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
@@ -33,6 +35,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name")); searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name"));
} }
/*
public Tuple<string, string> SelectedSearchResultPreference public Tuple<string, string> SelectedSearchResultPreference
{ {
get get
@@ -64,5 +67,6 @@ namespace Microsoft.PowerToys.Settings.UI.Views
} }
} }
} }
*/
} }
} }

View File

@@ -4,10 +4,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d" mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}"> <Grid ColumnSpacing="{StaticResource DefaultColumnSpacing}" RowSpacing="{StaticResource DefaultRowSpacing}">
<VisualStateManager.VisualStateGroups> <VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LayoutVisualStates"> <VisualStateGroup x:Name="LayoutVisualStates">
@@ -49,50 +50,51 @@
<ToggleSwitch x:Uid="PowerRename_Toggle_Enable" <ToggleSwitch x:Uid="PowerRename_Toggle_Enable"
Margin="{StaticResource MediumTopMargin}" Margin="{StaticResource MediumTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=IsEnabled}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"
/> />
<TextBlock x:Uid="PowerRename_ShellIntegration" <CustomControls:GroupTitleTextBlock
Style="{StaticResource SettingsGroupTitleStyle}"/> x:Uid="PowerRename_ShellIntegration"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/>
<ToggleSwitch x:Uid="PowerRename_Toggle_EnableOnContextMenu" <ToggleSwitch x:Uid="PowerRename_Toggle_EnableOnContextMenu"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=EnabledOnContextMenu}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.EnabledOnContextMenu}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<ToggleSwitch x:Uid="PowerRename_Toggle_EnableOnExtendedContextMenu" <ToggleSwitch x:Uid="PowerRename_Toggle_EnableOnExtendedContextMenu"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=EnabledOnContextExtendedMenu}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.EnabledOnContextExtendedMenu}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<TextBlock x:Uid="PowerRename_AutoCompleteHeader" <CustomControls:GroupTitleTextBlock x:Uid="PowerRename_AutoCompleteHeader"
Style="{StaticResource SettingsGroupTitleStyle}"/> IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<ToggleSwitch x:Uid="PowerRename_Toggle_AutoComplete" <ToggleSwitch x:Uid="PowerRename_Toggle_AutoComplete"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource SmallTopMargin}"
IsOn="{Binding Mode=TwoWay, Path=MRUEnabled}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.MRUEnabled}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
/> />
<muxc:NumberBox x:Uid="PowerRename_Toggle_MaxDispListNum" <CustomControls:BodyTextBlock x:Uid="PowerRename_Toggle_MaxDispListNum"
SpinButtonPlacementMode="Compact" Margin="{StaticResource SmallTopMargin}"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:NumberBox SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource HeaderTextTopMargin}"
Value="{Binding Mode=TwoWay, Path=MaxDispListNum}" Value="{x:Bind Mode=TwoWay, Path=ViewModel.MaxDispListNum}"
Minimum="0" Minimum="0"
Width="240" Width="240"
Maximum="20" Maximum="20"
IsEnabled="{ Binding Mode=TwoWay, Path=GlobalAndMruEnabled}" IsEnabled="{ x:Bind Mode=OneWay, Path=ViewModel.GlobalAndMruEnabled}"/>
/>
<ToggleSwitch x:Uid="PowerRename_Toggle_RestoreFlagsOnLaunch" <ToggleSwitch x:Uid="PowerRename_Toggle_RestoreFlagsOnLaunch"
Margin="0, 17, 0, 0" Margin="0, 17, 0, 0"
IsOn="{Binding Mode=TwoWay, Path=RestoreFlagsOnLaunch}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.RestoreFlagsOnLaunch}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
/>
</StackPanel> </StackPanel>
@@ -104,7 +106,8 @@
<TextBlock x:Uid="About_PowerRename" <TextBlock x:Uid="About_PowerRename"
Style="{StaticResource SettingsGroupTitleStyle}" Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"/> Margin="{StaticResource XSmallBottomMargin}"
/>
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerRename"> <HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_PowerRename">
<TextBlock x:Uid="Module_overview" /> <TextBlock x:Uid="Module_overview" />
@@ -117,7 +120,8 @@
<TextBlock <TextBlock
x:Uid="AttributionTitle" x:Uid="AttributionTitle"
Style="{StaticResource SettingsGroupTitleStyle}" /> Style="{StaticResource SettingsGroupTitleStyle}"
/>
<HyperlinkButton <HyperlinkButton
NavigateUri="https://github.com/chrdavis/SmartRename"> NavigateUri="https://github.com/chrdavis/SmartRename">

View File

@@ -14,14 +14,14 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{ {
public sealed partial class PowerRenamePage : Page public sealed partial class PowerRenamePage : Page
{ {
public PowerRenameViewModel ViewModel { get; set; } private PowerRenameViewModel ViewModel { get; set; }
public PowerRenamePage() public PowerRenamePage()
{ {
this.InitializeComponent(); this.InitializeComponent();
ViewModel = new PowerRenameViewModel(); ViewModel = new PowerRenameViewModel();
this.PowerRenameSettingsView.DataContext = ViewModel;
DataContext = ViewModel;
} }
} }
} }

View File

@@ -5,6 +5,8 @@
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views" xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels"
xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
mc:Ignorable="d" mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
@@ -48,51 +50,54 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<StackPanel Orientation="Vertical" x:Name="ShortCutGuideView"> <StackPanel Orientation="Vertical" x:Name="ShortCutGuideView">
<TextBlock x:Uid="ShortcutGuide_Description" <TextBlock x:Uid="ShortcutGuide_Description"
TextWrapping="Wrap"/> TextWrapping="Wrap"
/>
<ToggleSwitch x:Uid="ShortcutGuide_Enable" <ToggleSwitch x:Uid="ShortcutGuide_Enable"
IsOn="{ Binding Mode=TwoWay, Path=IsEnabled}" IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.IsEnabled}"
Margin="{StaticResource MediumTopMargin}"/> Margin="{StaticResource MediumTopMargin}"/>
<TextBlock x:Uid="ShortcutGuide_Appearance_Behavior" <CustomControls:GroupTitleTextBlock x:Uid="ShortcutGuide_Appearance_Behavior"
Style="{StaticResource SettingsGroupTitleStyle}"/> IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:NumberBox x:Uid="ShortcutGuide_PressTime" <CustomControls:BodyTextBlock x:Uid="ShortcutGuide_PressTime"
Minimum="100" Margin="{StaticResource SmallTopMargin}"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<muxc:NumberBox Minimum="100"
SpinButtonPlacementMode="Compact" SpinButtonPlacementMode="Compact"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Margin="{StaticResource SmallTopMargin}" Margin="{StaticResource HeaderTextTopMargin}"
Width="240" Width="240"
Value="{ Binding Mode=TwoWay, Path=PressTime}" Value="{x:Bind Mode=TwoWay, Path=ViewModel.PressTime}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}" SmallChange="50" LargeChange="100"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
SmallChange="50"
LargeChange="100"/>
<StackPanel Orientation="Horizontal" Margin="{StaticResource MediumTopMargin}" Spacing="12"> <StackPanel Orientation="Horizontal" Margin="{StaticResource MediumTopMargin}" Spacing="12">
<Slider x:Uid="ShortcutGuide_OverlayOpacity" <Slider x:Uid="ShortcutGuide_OverlayOpacity"
Minimum="0" Minimum="0"
Maximum="100" Maximum="100"
Width="240" Width="240"
Value="{ Binding Mode=TwoWay, Path=OverlayOpacity}" Value="{x:Bind Mode=TwoWay, Path=ViewModel.OverlayOpacity}"
IsThumbToolTipEnabled="False" IsThumbToolTipEnabled="False"
HorizontalAlignment="Left" HorizontalAlignment="Left"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"/> IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<TextBlock Text="{ Binding Mode=OneWay, Path=OverlayOpacity, Converter={StaticResource StringFormatConverter}, ConverterParameter=' {0}%' }" <CustomControls:BodyTextBlock Text="{x:Bind Mode=OneWay, Path=ViewModel.OverlayOpacity, Converter={StaticResource StringFormatConverter}, ConverterParameter=' {0}%' }"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="16" FontSize="16"
Margin="0,21,0,0"/> Margin="0,21,0,0"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
</StackPanel> </StackPanel>
<muxc:RadioButtons x:Uid="ShortcutGuide_Theme"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{ Binding Mode=TwoWay, Path=IsEnabled}"
SelectedIndex="{ Binding Mode=TwoWay, Path=ThemeIndex}">
<RadioButton x:Uid="GeneralPage_Radio_Theme_Dark"
IsChecked="{ Binding Mode=TwoWay, Path=IsDarkThemeRadioButtonChecked}"/>
<RadioButton x:Uid="GeneralPage_Radio_Theme_Light" <CustomControls:BodyTextBlock x:Uid="ShortcutGuide_Theme"
IsChecked="{ Binding Mode=TwoWay, Path=IsLightThemeRadioButtonChecked}"/> Margin="{StaticResource SmallTopMargin}"
IsActive="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<RadioButton x:Uid="GeneralPage_Radio_Theme_Default" <muxc:RadioButtons IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsChecked="{ Binding Mode=TwoWay, Path=IsSystemThemeRadioButtonChecked}"/> SelectedIndex="{x:Bind Mode=TwoWay, Path=ViewModel.ThemeIndex}"
Margin="{StaticResource HeaderTextTopMargin}">
<RadioButton x:Uid="GeneralPage_Radio_Theme_Dark"/>
<RadioButton x:Uid="GeneralPage_Radio_Theme_Light" />
<RadioButton x:Uid="GeneralPage_Radio_Theme_Default"/>
</muxc:RadioButtons> </muxc:RadioButtons>
</StackPanel> </StackPanel>
@@ -106,9 +111,8 @@
<TextBlock <TextBlock
x:Uid="About_ShortcutGuide" x:Uid="About_ShortcutGuide"
Style="{StaticResource SettingsGroupTitleStyle}" Style="{StaticResource SettingsGroupTitleStyle}"
Margin="{StaticResource XSmallBottomMargin}"/> Margin="{StaticResource XSmallBottomMargin}"
/>
<Image MaxWidth="240" Source="https://aka.ms/powerToysShortcutGuideSettingImage" />
<HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ShortcutGuide"> <HyperlinkButton NavigateUri="https://aka.ms/PowerToysOverview_ShortcutGuide">
<TextBlock x:Uid="Module_overview"/> <TextBlock x:Uid="Module_overview"/>

View File

@@ -9,13 +9,14 @@ namespace Microsoft.PowerToys.Settings.UI.Views
{ {
public sealed partial class ShortcutGuidePage : Page public sealed partial class ShortcutGuidePage : Page
{ {
public ShortcutGuideViewModel ViewModel { get; set; } private ShortcutGuideViewModel ViewModel { get; set; }
public ShortcutGuidePage() public ShortcutGuidePage()
{ {
InitializeComponent(); InitializeComponent();
ViewModel = new ShortcutGuideViewModel(); ViewModel = new ShortcutGuideViewModel();
this.ShortCutGuideView.DataContext = ViewModel; DataContext = ViewModel;
} }
} }
} }