This commit is contained in:
Niels Laute
2021-08-05 22:39:27 +02:00
parent fc4f2ffcea
commit 6bf2629acb
7 changed files with 193 additions and 214 deletions

View File

@@ -321,10 +321,6 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<data name="ColorPicker_ChangeCursor.Content" xml:space="preserve"> <data name="ColorPicker_ChangeCursor.Content" xml:space="preserve">
<value>Change cursor when picking a color</value> <value>Change cursor when picking a color</value>
</data> </data>
<data name="ColorPicker_ActivationShortcut.Header" xml:space="preserve">
<value>Activate Color Picker</value>
<comment>do not loc product name</comment>
</data>
<data name="PowerLauncher.ModuleDescription" xml:space="preserve"> <data name="PowerLauncher.ModuleDescription" xml:space="preserve">
<value>A quick launcher that has additional capabilities without sacrificing performance.</value> <value>A quick launcher that has additional capabilities without sacrificing performance.</value>
</data> </data>
@@ -916,7 +912,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<comment>Windows refers to the Operating system</comment> <comment>Windows refers to the Operating system</comment>
</data> </data>
<data name="ColorPicker_CopiedColorRepresentation.Header" xml:space="preserve"> <data name="ColorPicker_CopiedColorRepresentation.Header" xml:space="preserve">
<value>Color format for clipboard</value> <value>Default color format</value>
</data> </data>
<data name="ColorPickerFirst.Text" xml:space="preserve"> <data name="ColorPickerFirst.Text" xml:space="preserve">
<value>Color Picker with editor mode enabled</value> <value>Color Picker with editor mode enabled</value>
@@ -929,11 +925,14 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="EditorFirst.Text" xml:space="preserve"> <data name="EditorFirst.Text" xml:space="preserve">
<value>Editor</value> <value>Editor</value>
</data> </data>
<data name="ColorPicker_ActivationAction.Text" xml:space="preserve"> <data name="ColorPicker_ActivationAction.Header" xml:space="preserve">
<value>Activation behavior</value> <value>Activation behavior</value>
</data> </data>
<data name="ColorFormats.Text" xml:space="preserve"> <data name="ColorFormats.Header" xml:space="preserve">
<value>Picker behavior</value> <value>Picker behavior</value>
</data>
<data name="ColorPicker_CopiedColorRepresentation.Description" xml:space="preserve">
<value>This format will be copied to your clipboard</value>
</data> </data>
<data name="KBM_KeysCannotBeRemapped.Text" xml:space="preserve"> <data name="KBM_KeysCannotBeRemapped.Text" xml:space="preserve">
<value>Learn more about remapping limitations</value> <value>Learn more about remapping limitations</value>
@@ -970,11 +969,20 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="EditorFirst_Description.Text" xml:space="preserve"> <data name="EditorFirst_Description.Text" xml:space="preserve">
<value>Open directly into the editor mode</value> <value>Open directly into the editor mode</value>
</data> </data>
<data name="ColorPicker_ColorFormatsDescription.Text" xml:space="preserve"> <data name="ColorPicker_ColorFormats.Header" xml:space="preserve">
<value>Editor color formats</value> <value>Color formats</value>
</data> </data>
<data name="ColorPicker_ShowColorName.Content" xml:space="preserve"> <data name="ColorPicker_ColorFormats.Description" xml:space="preserve">
<value>Show color name</value> <value>Select which color formats (and in what order) should show up in the editor</value>
</data>
<data name="MoveUp.Text" xml:space="preserve">
<value>Move up</value>
</data>
<data name="MoveDown.Text" xml:space="preserve">
<value>Move down</value>
</data>
<data name="ColorPicker_ShowColorName.Content" xml:space="preserve">
<value>Show color name when color picking</value>
</data> </data>
<data name="ImageResizer_DefaultSize_Large" xml:space="preserve"> <data name="ImageResizer_DefaultSize_Large" xml:space="preserve">
<value>Large</value> <value>Large</value>
@@ -998,7 +1006,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="FancyZones_MoveWindowLeftRightBasedOnZoneIndex.Content" xml:space="preserve"> <data name="FancyZones_MoveWindowLeftRightBasedOnZoneIndex.Content" xml:space="preserve">
<value>Win + Left/Right to move windows based on zone index</value> <value>Win + Left/Right to move windows based on zone index</value>
</data> </data>
<data name="ColorPicker_Editor.Text" xml:space="preserve"> <data name="ColorPicker_Editor.Header" xml:space="preserve">
<value>Editor</value> <value>Editor</value>
</data> </data>
<data name="FancyZones_OverlappingZonesClosestCenter.Content" xml:space="preserve"> <data name="FancyZones_OverlappingZonesClosestCenter.Content" xml:space="preserve">
@@ -1081,7 +1089,7 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="FancyZones_QuickLayoutSwitch_GroupSettings.Text" xml:space="preserve"> <data name="FancyZones_QuickLayoutSwitch_GroupSettings.Text" xml:space="preserve">
<value>Quick layout switch</value> <value>Quick layout switch</value>
</data> </data>
<data name="ShortcutGuide_OpenShortcutGuide.Header" xml:space="preserve"> <data name="Activation_Shortcut.Header" xml:space="preserve">
<value>Activation shortcut</value> <value>Activation shortcut</value>
</data> </data>
<data name="Oobe_GetStarted.Text" xml:space="preserve"> <data name="Oobe_GetStarted.Text" xml:space="preserve">

View File

@@ -33,7 +33,7 @@
<toolkitcontrols:HeaderedItemsControl x:Uid="Awake_Behavior_GroupSettings" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"> <toolkitcontrols:HeaderedItemsControl x:Uid="Awake_Behavior_GroupSettings" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="Awake_EnableDisplayKeepAwake" Icon="&#xE7FB;"> <controls:Setting x:Uid="Awake_EnableDisplayKeepAwake" Icon="&#xE7FB;">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<ToggleSwitch FlowDirection="RightToLeft" IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" /> <ToggleSwitch FlowDirection="RightToLeft" IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" />

View File

@@ -5,8 +5,10 @@
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:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:Core="using:Microsoft.Xaml.Interactions.Core" xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d" mc:Ignorable="d"
AutomationProperties.LandmarkType="Main"> AutomationProperties.LandmarkType="Main">
@@ -16,118 +18,127 @@
<controls:SettingsPageControl.ModuleContent> <controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical" <StackPanel Orientation="Vertical"
x:Name="ColorPickerView" x:Name="ColorPickerView">
HorizontalAlignment="Left"
Margin="0,0,48,0"
MaxWidth="{StaticResource MaxContentWidth}">
<ToggleSwitch x:Uid="ColorPicker_EnableColorPicker"
IsOn="{Binding IsEnabled, Mode=TwoWay}"/>
<TextBlock x:Uid="Shortcuts" <controls:Setting x:Uid="ColorPicker_EnableColorPicker">
Style="{StaticResource SettingsGroupTitleStyle}" <controls:Setting.Icon>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> <BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsColorPicker.png" ShowAsMonochrome="False" />
</controls:Setting.Icon>
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent>
</controls:Setting>
<controls:HotkeySettingsControl x:Uid="ColorPicker_ActivationShortcut" <toolkitcontrols:HeaderedItemsControl x:Uid="Shortcuts" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
Margin="{StaticResource SmallTopMargin}" <controls:Setting x:Uid="Activation_Shortcut" Icon="&#xEDA7;">
HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" <controls:Setting.Description>
Keys="Win, Ctrl, Alt, Shift" <TextBlock>
Enabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" <Run x:Uid="ShortcutWarningLabel"/>
HorizontalAlignment="Left" <Run Text="Win, Ctrl, Alt, Shift"/>
MinWidth="240" </TextBlock>
/> </controls:Setting.Description>
<controls:Setting.ActionContent>
<controls:HotkeySettingsControl Width="240" HotkeySettings="{x:Bind Path=ViewModel.ActivationShortcut, Mode=TwoWay}" Keys="Win, Ctrl, Alt, Shift"/>
</controls:Setting.ActionContent>
</controls:Setting>
<TextBlock x:Uid="ColorPicker_ActivationAction" </toolkitcontrols:HeaderedItemsControl>
Margin="{StaticResource MediumTopMargin}"
x:Name="ColorPicker_ActivationAction"
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/>
<StackPanel AutomationProperties.LabeledBy="{Binding ElementName=ColorPicker_ActivationAction}">
<RadioButton
IsChecked="{Binding ActivationOpensColorPickerAndEditor, Mode=TwoWay}"
IsEnabled="{Binding IsEnabled}"
GroupName="ColorPickerActivationAction">
<RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="ColorPickerFirst"/>
<LineBreak/>
<Run Foreground="{ThemeResource SystemBaseMediumColor}"
x:Uid="ColorPickerFirst_Description"/>
</TextBlock>
</RadioButton.Content>
</RadioButton>
<RadioButton IsChecked="{Binding ActivationOpensEditor, Mode=TwoWay}"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{Binding IsEnabled}"
GroupName="ColorPickerActivationAction">
<RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="EditorFirst"/>
<LineBreak/>
<Run Foreground="{ThemeResource SystemBaseMediumColor}" x:Uid="EditorFirst_Description"/>
</TextBlock>
</RadioButton.Content>
</RadioButton>
<RadioButton IsChecked="{Binding ActivationOpensColorPickerOnly, Mode=TwoWay}"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{Binding IsEnabled}"
GroupName="ColorPickerActivationAction">
<RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="ColorPickerOnly"/>
<LineBreak/>
<Run x:Uid="ColorPickerOnly_Description" Foreground="{ThemeResource SystemBaseMediumColor}"/>
</TextBlock>
</RadioButton.Content>
</RadioButton>
</StackPanel>
<TextBlock x:Uid="ColorFormats" <muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
Style="{StaticResource SettingsGroupTitleStyle}" <muxc:Expander.Header>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}"/> <controls:Setting x:Uid="ColorPicker_ActivationAction" Icon="&#xEC4E;" Style="{StaticResource ExpanderHeaderSettingStyle}" />
</muxc:Expander.Header>
<muxc:Expander.Content>
<StackPanel Padding="56,16,16,24" Spacing="12">
<RadioButton IsChecked="{Binding ActivationOpensColorPickerAndEditor, Mode=TwoWay}" GroupName="ColorPickerActivationAction">
<RadioButton.Content>
<StackPanel>
<TextBlock x:Uid="ColorPickerFirst"/>
<TextBlock x:Uid="ColorPickerFirst_Description" Style="{StaticResource SecondaryTextStyle}"/>
</StackPanel>
</RadioButton.Content>
</RadioButton>
<ComboBox x:Name="ColorPicker_ComboBox" <RadioButton IsChecked="{Binding ActivationOpensEditor, Mode=TwoWay}" GroupName="ColorPickerActivationAction">
x:Uid="ColorPicker_CopiedColorRepresentation" <RadioButton.Content>
MinWidth="240" <StackPanel>
Margin="{StaticResource SmallTopMargin}" <TextBlock x:Uid="EditorFirst"/>
HorizontalAlignment="Left" <TextBlock x:Uid="EditorFirst_Description" Style="{StaticResource SecondaryTextStyle}"/>
DisplayMemberPath="Value" </StackPanel>
IsEnabled="{Binding IsEnabled}" </RadioButton.Content>
ItemsSource="{Binding SelectableColorRepresentations}" </RadioButton>
Loaded="ColorPicker_ComboBox_Loaded"
SelectedValue="{Binding SelectedColorRepresentationValue, Mode=TwoWay}"
SelectedValuePath="Key" />
<CheckBox x:Uid="ColorPicker_ShowColorName" <RadioButton IsChecked="{Binding ActivationOpensColorPickerOnly, Mode=TwoWay}" GroupName="ColorPickerActivationAction">
IsChecked="{Binding ShowColorName, Mode=TwoWay}" <RadioButton.Content>
Margin="{StaticResource SmallTopMargin}" <StackPanel>
IsEnabled="{Binding IsEnabled}"/> <TextBlock x:Uid="ColorPickerOnly"/>
<TextBlock x:Uid="ColorPickerOnly_Description" Style="{StaticResource SecondaryTextStyle}"/>
</StackPanel>
</RadioButton.Content>
</RadioButton>
</StackPanel>
</muxc:Expander.Content>
</muxc:Expander>
<TextBlock x:Uid="ColorPicker_Editor"
Style="{StaticResource SettingsGroupTitleStyle}"
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}" />
<TextBlock x:Name="ColorFormatsListViewLabel" <toolkitcontrols:HeaderedItemsControl x:Uid="ColorFormats" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
TextWrapping="WrapWholeWords" <muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}">
x:Uid="ColorPicker_ColorFormatsDescription" <muxc:Expander.Header>
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}" <controls:Setting x:Uid="ColorPicker_CopiedColorRepresentation" Icon="&#xEF3C;" Style="{StaticResource ExpanderHeaderSettingStyle}">
Margin="{StaticResource SmallTopMargin}"/> <controls:Setting.ActionContent>
<ComboBox MinWidth="240"
x:Name="ColorPicker_ComboBox"
HorizontalAlignment="Left"
DisplayMemberPath="Value"
ItemsSource="{Binding SelectableColorRepresentations}"
Loaded="ColorPicker_ComboBox_Loaded"
SelectedValue="{Binding SelectedColorRepresentationValue, Mode=TwoWay}"
SelectedValuePath="Key" />
</controls:Setting.ActionContent>
</controls:Setting>
</muxc:Expander.Header>
<muxc:Expander.Content>
<CheckBox x:Uid="ColorPicker_ShowColorName"
IsChecked="{Binding ShowColorName, Mode=TwoWay}"
Margin="{StaticResource ExpanderSettingMargin}" />
</muxc:Expander.Content>
</muxc:Expander>
<!-- Disabled reordering by dragging --> <!--
<!-- CanReorderItems="True" AllowDrop="True" --> Disabling this until we have a safer way to reset cursor as
<ListView ItemsSource="{Binding ColorFormats, Mode=TwoWay}" we can hit a state where the cursor doesn't reset
MaxWidth="466"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" <CheckBox x:Uid="ColorPicker_ChangeCursor"
AutomationProperties.LabeledBy="{Binding ElementName=ColorFormatsListViewLabel}" IsChecked="{Binding ChangeCursor, Mode=TwoWay}"
HorizontalAlignment="Left" Margin="{StaticResource SmallTopMargin}"
Margin="-12,6,0,0"> IsEnabled="{Binding IsEnabled}"/>
<ItemsControl.ItemContainerTransitions> -->
<TransitionCollection/> </toolkitcontrols:HeaderedItemsControl>
</ItemsControl.ItemContainerTransitions>
<ListView.ItemTemplate> <toolkitcontrols:HeaderedItemsControl x:Uid="ColorPicker_Editor" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<DataTemplate> <controls:Setting x:Uid="ColorPicker_ColorFormats" Icon="&#xE14C;"/>
<Grid Width="420" Background="Transparent">
<!-- Disabled reordering by dragging <!-- Disabled reordering by dragging -->
<!-- CanReorderItems="True" AllowDrop="True" -->
<ListView ItemsSource="{Binding ColorFormats, Mode=TwoWay}"
SelectionMode="None"
HorizontalAlignment="Stretch">
<ItemsControl.ItemContainerTransitions>
<TransitionCollection/>
</ItemsControl.ItemContainerTransitions>
<ListView.ItemTemplate>
<DataTemplate>
<Grid
HorizontalAlignment="Stretch"
Background="{ThemeResource CardBackgroundBrush}"
BorderThickness="{ThemeResource CardBorderThickness}"
BorderBrush="{ThemeResource CardBorderBrush}"
CornerRadius="{ThemeResource ControlCornerRadius}"
Padding="0,0,16,0"
MinHeight="68">
<!-- Disabled reordering by dragging
<Interactivity:Interaction.Behaviors> <Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="PointerEntered"> <Core:EventTriggerBehavior EventName="PointerEntered">
@@ -138,36 +149,26 @@
</Core:EventTriggerBehavior> </Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors> --> </Interactivity:Interaction.Behaviors> -->
<Interactivity:Interaction.Behaviors> <Grid.RowDefinitions>
<Core:EventTriggerBehavior EventName="PointerEntered"> <RowDefinition/>
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonUp}" PropertyName="Visibility" Value="Visible" /> <RowDefinition/>
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonDown}" PropertyName="Visibility" Value="Visible" /> </Grid.RowDefinitions>
</Core:EventTriggerBehavior> <TextBlock FontWeight="SemiBold"
<Core:EventTriggerBehavior EventName="PointerExited">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonUp}" PropertyName="Visibility" Value="Collapsed" />
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonDown}" PropertyName="Visibility" Value="Collapsed" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock FontWeight="SemiBold"
FontSize="16" FontSize="16"
Margin="0,8,0,0" Margin="56,8,0,0"
Text="{Binding Name}"/> Text="{Binding Name}"/>
<TextBlock Foreground="{ThemeResource SystemBaseMediumColor}" <TextBlock Style="{StaticResource SecondaryTextStyle}"
Text="{Binding Example}" Text="{Binding Example}"
Grid.Row="1" Grid.Row="1"
Margin="0,0,0,8"/> Margin="56,0,0,8"/>
<ToggleSwitch IsOn="{Binding IsShown, Mode=TwoWay}" <ToggleSwitch IsOn="{Binding IsShown, Mode=TwoWay}"
OnContent="" OnContent=""
OffContent="" OffContent=""
Grid.RowSpan="2" FlowDirection="RightToLeft"
Grid.RowSpan="2"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,-36,0"/> Margin="0,0,56,0"/>
<!-- Disabled reordering by dragging <!-- Disabled reordering by dragging
<TextBlock Text="&#xE76F;" <TextBlock Text="&#xE76F;"
Visibility="Collapsed" Visibility="Collapsed"
@@ -179,57 +180,29 @@
Margin="0,0,36,0" Margin="0,0,36,0"
FontFamily="Segoe MDL2 Assets" /> --> FontFamily="Segoe MDL2 Assets" /> -->
<Button x:Uid="ColorPicker_ButtonUp" <Button Background="Transparent"
x:Name="ButtonUp" FontFamily="{ThemeResource SymbolThemeFontFamily}"
Content="&#xE74A;" HorizontalAlignment="Right"
IsEnabled="{Binding CanMoveUp}" VerticalAlignment="Center"
Grid.Row="0" Grid.RowSpan="2"
HorizontalAlignment="Right" Content="&#xE10C;">
Margin="0,0,24,4" <Button.Flyout>
Background="Transparent" <MenuFlyout>
Visibility="Collapsed" <MenuFlyoutItem IsEnabled="{Binding CanMoveUp}" Icon="Up" x:Uid="MoveUp" Click="ReorderButtonUp_Click"/>
FontFamily="Segoe MDL2 Assets" <MenuFlyoutItem IsEnabled="{Binding CanMoveDown}" x:Uid="MoveDown" Click="ReorderButtonDown_Click">
Click="ReorderButtonUp_Click"> <MenuFlyoutItem.Icon>
<Interactivity:Interaction.Behaviors> <FontIcon Glyph="&#xE1FD;" />
<Core:EventTriggerBehavior EventName="Click"> </MenuFlyoutItem.Icon>
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonUp}" PropertyName="Visibility" Value="Collapsed" /> </MenuFlyoutItem>
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonDown}" PropertyName="Visibility" Value="Collapsed" /> </MenuFlyout>
</Core:EventTriggerBehavior> </Button.Flyout>
</Interactivity:Interaction.Behaviors> </Button>
</Button> </Grid>
<Button x:Uid="ColorPicker_ButtonDown" </DataTemplate>
x:Name="ButtonDown" </ListView.ItemTemplate>
Content="&#xE74B;" </ListView>
IsEnabled="{Binding CanMoveDown}" </toolkitcontrols:HeaderedItemsControl>
Grid.Row="1" </StackPanel>
HorizontalAlignment="Right"
Margin="0,0,24,0"
Background="Transparent"
Visibility="Collapsed"
FontFamily="Segoe MDL2 Assets"
Click="ReorderButtonDown_Click" >
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Click">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonUp}" PropertyName="Visibility" Value="Collapsed" />
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ButtonDown}" PropertyName="Visibility" Value="Collapsed" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</Button>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<!--
Disabling this until we have a safer way to reset cursor as
we can hit a state where the cursor doesn't reset
<CheckBox x:Uid="ColorPicker_ChangeCursor"
IsChecked="{Binding ChangeCursor, Mode=TwoWay}"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{Binding IsEnabled}"/>
-->
</StackPanel>
</controls:SettingsPageControl.ModuleContent> </controls:SettingsPageControl.ModuleContent>

View File

@@ -50,7 +50,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
private void ReorderButtonUp_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) private void ReorderButtonUp_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{ {
ColorFormatModel color = ((Button)sender).DataContext as ColorFormatModel; ColorFormatModel color = ((MenuFlyoutItem)sender).DataContext as ColorFormatModel;
if (color == null) if (color == null)
{ {
return; return;
@@ -65,7 +65,7 @@ namespace Microsoft.PowerToys.Settings.UI.Views
private void ReorderButtonDown_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) private void ReorderButtonDown_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
{ {
ColorFormatModel color = ((Button)sender).DataContext as ColorFormatModel; ColorFormatModel color = ((MenuFlyoutItem)sender).DataContext as ColorFormatModel;
if (color == null) if (color == null)
{ {
return; return;

View File

@@ -34,28 +34,26 @@
</controls:Setting> </controls:Setting>
<toolkitcontrols:HeaderedItemsControl x:Uid="ImageResizer_CustomSizes"> <toolkitcontrols:HeaderedItemsControl x:Uid="ImageResizer_CustomSizes" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting x:Uid="ImageResizer_CustomSizes" Icon="&#xE2B2;"> <controls:Setting x:Uid="ImageResizer_CustomSizes" Icon="&#xE2B2;">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<Button x:Uid="ImageResizer_AddSizeButton" Click="AddSizeButton_Click" Style="{ThemeResource AccentButtonStyle}" /> <Button x:Uid="ImageResizer_AddSizeButton" Click="AddSizeButton_Click" Style="{ThemeResource AccentButtonStyle}" />
</controls:Setting.ActionContent> </controls:Setting.ActionContent>
</controls:Setting> </controls:Setting>
</toolkitcontrols:HeaderedItemsControl>
<ListView x:Name="ImagesSizesListView"
<ListView x:Name="ImagesSizesListView"
x:Uid="ImagesSizesListView" x:Uid="ImagesSizesListView"
ItemsSource="{x:Bind ViewModel.Sizes, Mode=TwoWay}" ItemsSource="{x:Bind ViewModel.Sizes, Mode=TwoWay}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
SelectionMode="None" SelectionMode="None"
ScrollViewer.HorizontalScrollMode="Enabled" ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.IsHorizontalRailEnabled="True" ScrollViewer.IsHorizontalRailEnabled="True"
ContainerContentChanging="ImagesSizesListView_ContainerContentChanging"> ContainerContentChanging="ImagesSizesListView_ContainerContentChanging">
<ListView.ItemTemplate>
<ListView.ItemTemplate>
<DataTemplate x:Name="SingleLineDataTemplate" x:DataType="models:ImageSize"> <DataTemplate x:Name="SingleLineDataTemplate" x:DataType="models:ImageSize">
<Grid AutomationProperties.Name="{x:Bind Name, Mode=OneWay}" HorizontalAlignment="Stretch" <Grid AutomationProperties.Name="{x:Bind Name, Mode=OneWay}"
HorizontalAlignment="Stretch"
Background="{ThemeResource CardBackgroundBrush}" Background="{ThemeResource CardBackgroundBrush}"
BorderThickness="{ThemeResource CardBorderThickness}" BorderThickness="{ThemeResource CardBorderThickness}"
BorderBrush="{ThemeResource CardBorderBrush}" BorderBrush="{ThemeResource CardBorderBrush}"
@@ -71,7 +69,8 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Grid.Column="1" Margin="0,0,16,0"> <StackPanel Orientation="Vertical" VerticalAlignment="Center" Grid.Column="1" Margin="0,0,16,0">
<TextBlock Text="{x:Bind Name, Mode=OneWay}"/> <TextBlock Text="{x:Bind Name, Mode=OneWay}" FontWeight="SemiBold"
FontSize="16"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,4,0,0"> <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" Margin="0,4,0,0">
<TextBlock Text="{x:Bind Fit, Mode=OneWay, Converter={StaticResource ImageResizerFitToStringConverter}}" Style="{ThemeResource SecondaryTextStyle}" Margin="0,0,4,0"/> <TextBlock Text="{x:Bind Fit, Mode=OneWay, Converter={StaticResource ImageResizerFitToStringConverter}}" Style="{ThemeResource SecondaryTextStyle}" Margin="0,0,4,0"/>
<TextBlock Text="{x:Bind Width, Mode=OneWay}" FontWeight="SemiBold" Margin="0,0,4,0" Style="{ThemeResource SecondaryTextStyle}"/> <TextBlock Text="{x:Bind Width, Mode=OneWay}" FontWeight="SemiBold" Margin="0,0,4,0" Style="{ThemeResource SecondaryTextStyle}"/>
@@ -162,15 +161,14 @@
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListView.ItemTemplate>
</ListView> </ListView>
</toolkitcontrols:HeaderedItemsControl>
<toolkitcontrols:HeaderedItemsControl x:Uid="Encoding" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<toolkitcontrols:HeaderedItemsControl x:Uid="Encoding">
<controls:Setting x:Uid="ImageResizer_FallBackEncoderText"> <controls:Setting x:Uid="ImageResizer_FallBackEncoderText">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<ComboBox SelectedIndex="{x:Bind Path=ViewModel.Encoder, Mode=TwoWay}" <ComboBox SelectedIndex="{x:Bind Path=ViewModel.Encoder, Mode=TwoWay}"
MinWidth="240" MinWidth="240">
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" />
@@ -221,7 +219,7 @@
</toolkitcontrols:HeaderedItemsControl> </toolkitcontrols:HeaderedItemsControl>
<toolkitcontrols:HeaderedItemsControl x:Uid="File"> <toolkitcontrols:HeaderedItemsControl x:Uid="File" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}"> <muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}">
<muxc:Expander.Header> <muxc:Expander.Header>
<controls:Setting x:Uid="ImageResizer_FilenameFormatHeader" Style="{StaticResource ExpanderHeaderSettingStyle}"> <controls:Setting x:Uid="ImageResizer_FilenameFormatHeader" Style="{StaticResource ExpanderHeaderSettingStyle}">
@@ -230,8 +228,7 @@
<TextBox Text="{x:Bind Mode=TwoWay, Path=ViewModel.FileName}" <TextBox Text="{x:Bind Mode=TwoWay, Path=ViewModel.FileName}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
MinWidth="240" MinWidth="240"
x:Uid="ImageResizer_FilenameFormatPlaceholder" x:Uid="ImageResizer_FilenameFormatPlaceholder"/>
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"/>
<Button Content="&#xE946;" FontFamily="{ThemeResource SymbolThemeFontFamily}"> <Button Content="&#xE946;" FontFamily="{ThemeResource SymbolThemeFontFamily}">
<ToolTipService.ToolTip> <ToolTipService.ToolTip>
<ToolTip> <ToolTip>

View File

@@ -51,6 +51,7 @@
x:Name="navigationView" x:Name="navigationView"
Background="{ThemeResource HomePageBackgroundBrush}" Background="{ThemeResource HomePageBackgroundBrush}"
IsBackButtonVisible="Collapsed" IsBackButtonVisible="Collapsed"
IsTitleBarAutoPaddingEnabled="False" IsTitleBarAutoPaddingEnabled="False"
IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}" IsBackEnabled="{x:Bind ViewModel.IsBackEnabled, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}" SelectedItem="{x:Bind ViewModel.Selected, Mode=OneWay}"

View File

@@ -36,7 +36,7 @@
</controls:Setting> </controls:Setting>
<controls:Setting x:Uid="ShortcutGuide_OpenShortcutGuide" Icon="&#xEDA7;" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"> <controls:Setting x:Uid="Activation_Shortcut" Icon="&#xEDA7;" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}">
<controls:Setting.Description> <controls:Setting.Description>
<TextBlock> <TextBlock>
<Run x:Uid="ShortcutWarningLabel"/> <Run x:Uid="ShortcutWarningLabel"/>