Awake UX update

This commit is contained in:
Niels Laute
2021-08-02 16:15:15 +02:00
parent 6c81c95e2b
commit 001527dd54
4 changed files with 71 additions and 51 deletions

View File

@@ -742,7 +742,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera
<data name="GeneralPage_ToggleSwitch_AutoDownloadUpdates.Header" xml:space="preserve"> <data name="GeneralPage_ToggleSwitch_AutoDownloadUpdates.Header" xml:space="preserve">
<value>Download updates automatically</value> <value>Download updates automatically</value>
</data> </data>
<data name="GeneralPage_ToggleSwitch_AutoDownloadUpdates.Description" xml:space="preserve"> <data name="GeneralPage_ToggleSwitch_AutoDownloadUpdates.Description" xml:space="preserve">
<value>Except on metered connections</value> <value>Except on metered connections</value>
</data> </data>
<data name="GeneralPage_ToggleSwitch_RunningAsAdminNote.Text" xml:space="preserve"> <data name="GeneralPage_ToggleSwitch_RunningAsAdminNote.Text" xml:space="preserve">
@@ -1287,13 +1287,13 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and
<data name="Awake_TemporaryKeepAwakeDescription.Text" xml:space="preserve"> <data name="Awake_TemporaryKeepAwakeDescription.Text" xml:space="preserve">
<value>Keeps your PC awake until the set time elapses</value> <value>Keeps your PC awake until the set time elapses</value>
</data> </data>
<data name="Awake_EnableDisplayKeepAwake.Content" xml:space="preserve"> <data name="Awake_EnableDisplayKeepAwake.Header" xml:space="preserve">
<value>Keep screen on</value> <value>Keep screen on</value>
</data> </data>
<data name="Awake_Mode.Text" xml:space="preserve"> <data name="Awake_Mode.Header" xml:space="preserve">
<value>Mode</value> <value>Mode</value>
</data> </data>
<data name="Awake_Behavior_GroupSettings.Text" xml:space="preserve"> <data name="Awake_Behavior_GroupSettings.Header" xml:space="preserve">
<value>Behavior</value> <value>Behavior</value>
</data> </data>
<data name="Awake_TemporaryKeepAwake_Hours.Header" xml:space="preserve"> <data name="Awake_TemporaryKeepAwake_Hours.Header" xml:space="preserve">
@@ -1389,4 +1389,7 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and
<data name="SeeWhatsNew.Content" xml:space="preserve"> <data name="SeeWhatsNew.Content" xml:space="preserve">
<value>See what's new</value> <value>See what's new</value>
</data> </data>
<data name="Awake_Mode.Description" xml:space="preserve">
<value>Set the preferred state of your computer</value>
</data>
</root> </root>

View File

@@ -7,6 +7,7 @@
xmlns:c="using:Microsoft.PowerToys.Settings.UI.Converters" xmlns:c="using:Microsoft.PowerToys.Settings.UI.Converters"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"
xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d" mc:Ignorable="d"
AutomationProperties.LandmarkType="Main"> AutomationProperties.LandmarkType="Main">
@@ -19,66 +20,73 @@
ModuleImageLink="https://aka.ms/PowerToysOverview_Awake"> ModuleImageLink="https://aka.ms/PowerToysOverview_Awake">
<controls:SettingsPageControl.ModuleContent> <controls:SettingsPageControl.ModuleContent>
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<ToggleSwitch x:Uid="Awake_EnableAwake" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
<TextBlock x:Uid="Awake_Behavior_GroupSettings" <controls:Setting x:Uid="Awake_EnableAwake">
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}" <controls:Setting.Icon>
Style="{StaticResource SettingsGroupTitleStyle}"/> <BitmapIcon UriSource="ms-appx:///Assets/FluentIcons/FluentIconsAwake.png" ShowAsMonochrome="False" />
</controls:Setting.Icon>
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent>
</controls:Setting>
<CheckBox x:Uid="Awake_EnableDisplayKeepAwake"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsChecked="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}"
Margin="{StaticResource XSmallTopMargin}" />
<TextBlock x:Uid="Awake_Mode"
Margin="{StaticResource SmallTopMargin}"
x:Name="ModeTitleLabel"
Opacity="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled, Converter={StaticResource ModuleEnabledToOpacityConverter}}" />
<StackPanel AutomationProperties.LabeledBy="{Binding ElementName=ModeTitleLabel}"
Margin="0,-8,0,0"> <toolkitcontrols:HeaderedItemsControl x:Uid="Awake_Behavior_GroupSettings">
<RadioButton x:Uid="Awake_NoKeepAwake" <controls:Setting x:Uid="Awake_EnableDisplayKeepAwake" Icon="&#xE7FB;">
Margin="{StaticResource SmallTopMargin}" <controls:Setting.ActionContent>
<ToggleSwitch FlowDirection="RightToLeft" IsOn="{x:Bind ViewModel.KeepDisplayOn, Mode=TwoWay}" />
</controls:Setting.ActionContent>
</controls:Setting>
<muxc:Expander IsExpanded="True" Style="{StaticResource SettingsExpanderStyle}">
<muxc:Expander.Header>
<controls:Setting x:Uid="Awake_Mode" Icon="&#xEC4E;" Style="{StaticResource ExpanderHeaderSettingStyle}" />
</muxc:Expander.Header>
<muxc:Expander.Content>
<StackPanel Padding="16" Spacing="12">
<RadioButton x:Uid="Awake_NoKeepAwake"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=0}"> IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=0}">
<RadioButton.Content> <RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20"> <TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="Awake_NoKeepAwakeContent"/> <Run x:Uid="Awake_NoKeepAwakeContent"/>
<LineBreak/> <LineBreak/>
<Run Foreground="{ThemeResource SystemBaseMediumColor}" <Run Foreground="{ThemeResource TextFillColorSecondaryBrush}"
x:Uid="Awake_NoKeepAwakeDescription"/> x:Uid="Awake_NoKeepAwakeDescription"/>
</TextBlock> </TextBlock>
</RadioButton.Content> </RadioButton.Content>
</RadioButton> </RadioButton>
<RadioButton x:Uid="Awake_IndefiniteKeepAwake" <RadioButton x:Uid="Awake_IndefiniteKeepAwake"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=1}"> IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=1}">
<RadioButton.Content> <RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20"> <TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="Awake_IndefiniteKeepAwakeContent"/> <Run x:Uid="Awake_IndefiniteKeepAwakeContent"/>
<LineBreak/> <LineBreak/>
<Run Foreground="{ThemeResource SystemBaseMediumColor}" <Run Foreground="{ThemeResource TextFillColorSecondaryBrush}"
x:Uid="Awake_IndefiniteKeepAwakeDescription"/> x:Uid="Awake_IndefiniteKeepAwakeDescription"/>
</TextBlock> </TextBlock>
</RadioButton.Content> </RadioButton.Content>
</RadioButton> </RadioButton>
<RadioButton x:Uid="Awake_TemporaryKeepAwake" <RadioButton x:Uid="Awake_TemporaryKeepAwake"
Margin="{StaticResource SmallTopMargin}"
IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}" IsEnabled="{x:Bind Mode=OneWay, Path=ViewModel.IsEnabled}"
IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=2}"> IsChecked="{x:Bind Path=ViewModel.Mode, Mode=TwoWay, Converter={StaticResource AwakeModeToBoolConverter}, ConverterParameter=2}">
<RadioButton.Content> <RadioButton.Content>
<TextBlock TextWrapping="WrapWholeWords" LineHeight="20"> <TextBlock TextWrapping="WrapWholeWords" LineHeight="20">
<Run x:Uid="Awake_TemporaryKeepAwakeContent"/> <Run x:Uid="Awake_TemporaryKeepAwakeContent"/>
<LineBreak/> <LineBreak/>
<Run Foreground="{ThemeResource SystemBaseMediumColor}" <Run Foreground="{ThemeResource TextFillColorSecondaryBrush}"
x:Uid="Awake_TemporaryKeepAwakeDescription"/> x:Uid="Awake_TemporaryKeepAwakeDescription"/>
</TextBlock> </TextBlock>
</RadioButton.Content> </RadioButton.Content>
</RadioButton> </RadioButton>
<StackPanel AutomationProperties.LabeledBy="{Binding ElementName=ModeTitleLabel}"
Margin="0,-8,0,0">
<StackPanel Margin="28,8,0,0" Orientation="Horizontal"> <StackPanel Margin="28,8,0,0" Orientation="Horizontal">
<muxc:NumberBox x:Uid="Awake_TemporaryKeepAwake_Hours" <muxc:NumberBox x:Uid="Awake_TemporaryKeepAwake_Hours"
Value="{x:Bind ViewModel.Hours, Mode=TwoWay}" Value="{x:Bind ViewModel.Hours, Mode=TwoWay}"
Minimum="0" Minimum="0"
SpinButtonPlacementMode="Compact" SpinButtonPlacementMode="Compact"
@@ -87,7 +95,7 @@
IsEnabled="{x:Bind ViewModel.IsTimeConfigurationEnabled, Mode=OneWay}" IsEnabled="{x:Bind ViewModel.IsTimeConfigurationEnabled, Mode=OneWay}"
SmallChange="1" SmallChange="1"
LargeChange="5"/> LargeChange="5"/>
<muxc:NumberBox x:Uid="Awake_TemporaryKeepAwake_Minutes" <muxc:NumberBox x:Uid="Awake_TemporaryKeepAwake_Minutes"
Value="{x:Bind ViewModel.Minutes, Mode=TwoWay}" Value="{x:Bind ViewModel.Minutes, Mode=TwoWay}"
Minimum="0" Minimum="0"
SpinButtonPlacementMode="Compact" SpinButtonPlacementMode="Compact"
@@ -97,8 +105,16 @@
MinWidth="90" MinWidth="90"
SmallChange="1" SmallChange="1"
LargeChange="5"/> LargeChange="5"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel>
</muxc:Expander.Content>
</muxc:Expander>
</toolkitcontrols:HeaderedItemsControl>
</StackPanel> </StackPanel>
</controls:SettingsPageControl.ModuleContent> </controls:SettingsPageControl.ModuleContent>

View File

@@ -189,7 +189,8 @@
<StackPanel Orientation="Vertical"> <StackPanel Orientation="Vertical">
<controls:Setting x:Uid="GeneralSettings_AlwaysRunAsAdminText" IsEnabled="{Binding Mode=TwoWay, Path=IsElevated}" Style="{StaticResource ExpanderContentSettingStyle}"> <controls:Setting x:Uid="GeneralSettings_AlwaysRunAsAdminText" IsEnabled="{Binding Mode=TwoWay, Path=IsElevated}" Style="{StaticResource ExpanderContentSettingStyle}">
<controls:Setting.Description> <controls:Setting.Description>
<HyperlinkButton NavigateUri="https://aka.ms/powertoysDetectedElevatedHelp" <HyperlinkButton
NavigateUri="https://aka.ms/powertoysDetectedElevatedHelp"
x:Uid="GeneralPage_ToggleSwitch_AlwaysRunElevated_Link"/> x:Uid="GeneralPage_ToggleSwitch_AlwaysRunElevated_Link"/>
</controls:Setting.Description> </controls:Setting.Description>
<controls:Setting.ActionContent> <controls:Setting.ActionContent>

View File

@@ -40,13 +40,13 @@
<toolkitcontrols:HeaderedItemsControl x:Uid="FileExplorerPreview_PreviewPane_GroupSettings"> <toolkitcontrols:HeaderedItemsControl x:Uid="FileExplorerPreview_PreviewPane_GroupSettings">
<controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_Preview_SVG" Icon="&#xE12A;"> <controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_Preview_SVG" Icon="&#xE91B;">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGRenderIsEnabled}" FlowDirection="RightToLeft" /> <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGRenderIsEnabled}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent> </controls:Setting.ActionContent>
</controls:Setting> </controls:Setting>
<controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_Preview_MD" Icon="&#xE12A;"> <controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_Preview_MD" Icon="&#xE943;">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.MDRenderIsEnabled}" FlowDirection="RightToLeft" /> <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.MDRenderIsEnabled}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent> </controls:Setting.ActionContent>
@@ -54,7 +54,7 @@
</toolkitcontrols:HeaderedItemsControl> </toolkitcontrols:HeaderedItemsControl>
<toolkitcontrols:HeaderedItemsControl x:Uid="FileExplorerPreview_IconThumbnail_GroupSettings"> <toolkitcontrols:HeaderedItemsControl x:Uid="FileExplorerPreview_IconThumbnail_GroupSettings">
<controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_SVG_Thumbnail" Icon="&#xE12A;"> <controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_SVG_Thumbnail" Icon="&#xE91B;">
<controls:Setting.ActionContent> <controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGThumbnailIsEnabled}" FlowDirection="RightToLeft" /> <ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGThumbnailIsEnabled}" FlowDirection="RightToLeft" />
</controls:Setting.ActionContent> </controls:Setting.ActionContent>