[Settings] Add "new" labels to navigation for new utilities (#36939)
* initial implementation * move new label to zoomit * cleanup * more cleanup * fix XAML formatting * update padding to 4px * add badge to dashboard item * fix XAML formatting * Tweaking UX --------- Co-authored-by: Niels Laute <niels.laute@live.nl> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
Родитель
ab8df1a906
Коммит
318cb32d13
|
@ -11,6 +11,7 @@
|
||||||
<ResourceDictionary Source="/SettingsXAML/Controls/KeyVisual/KeyVisual.xaml" />
|
<ResourceDictionary Source="/SettingsXAML/Controls/KeyVisual/KeyVisual.xaml" />
|
||||||
<ResourceDictionary Source="/SettingsXAML/Styles/TextBlock.xaml" />
|
<ResourceDictionary Source="/SettingsXAML/Styles/TextBlock.xaml" />
|
||||||
<ResourceDictionary Source="/SettingsXAML/Styles/Button.xaml" />
|
<ResourceDictionary Source="/SettingsXAML/Styles/Button.xaml" />
|
||||||
|
<ResourceDictionary Source="/SettingsXAML/Styles/InfoBadge.xaml" />
|
||||||
<ResourceDictionary Source="/SettingsXAML/Themes/Colors.xaml" />
|
<ResourceDictionary Source="/SettingsXAML/Themes/Colors.xaml" />
|
||||||
<ResourceDictionary Source="/SettingsXAML/Themes/Generic.xaml" />
|
<ResourceDictionary Source="/SettingsXAML/Themes/Generic.xaml" />
|
||||||
<!-- Other merged dictionaries here -->
|
<!-- Other merged dictionaries here -->
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
|
||||||
|
<Style x:Key="NewInfoBadge" TargetType="InfoBadge">
|
||||||
|
<Setter Property="Padding" Value="5,1,5,2" />
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="InfoBadge">
|
||||||
|
<Border
|
||||||
|
x:Name="RootGrid"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
CornerRadius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.InfoBadgeCornerRadius}">
|
||||||
|
<TextBlock
|
||||||
|
x:Uid="SettingsPage_NewInfoBadge"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
FontSize="10" />
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
|
@ -348,17 +348,28 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Width="20" Margin="0,0,0,0">
|
<Image
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="20"
|
||||||
|
Margin="0,0,0,0">
|
||||||
<Image.Source>
|
<Image.Source>
|
||||||
<BitmapImage UriSource="{x:Bind Icon, Mode=OneWay}" />
|
<BitmapImage UriSource="{x:Bind Icon, Mode=OneWay}" />
|
||||||
</Image.Source>
|
</Image.Source>
|
||||||
</Image>
|
</Image>
|
||||||
<TextBlock
|
<StackPanel
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontWeight="SemiBold"
|
Orientation="Horizontal">
|
||||||
Text="{x:Bind Label, Mode=OneWay}"
|
<TextBlock
|
||||||
TextTrimming="CharacterEllipsis" />
|
VerticalAlignment="Center"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="{x:Bind Label, Mode=OneWay}"
|
||||||
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
<InfoBadge
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Style="{StaticResource NewInfoBadge}"
|
||||||
|
Visibility="{x:Bind IsNew, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Width="20"
|
Width="20"
|
||||||
|
@ -440,17 +451,25 @@
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Image Width="20">
|
<Image Grid.Column="0" Width="20">
|
||||||
<Image.Source>
|
<Image.Source>
|
||||||
<BitmapImage UriSource="{x:Bind Icon, Mode=OneWay}" />
|
<BitmapImage UriSource="{x:Bind Icon, Mode=OneWay}" />
|
||||||
</Image.Source>
|
</Image.Source>
|
||||||
</Image>
|
</Image>
|
||||||
<TextBlock
|
<StackPanel
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
FontWeight="SemiBold"
|
Orientation="Horizontal">
|
||||||
Text="{x:Bind Label, Mode=OneWay}"
|
<TextBlock
|
||||||
TextTrimming="CharacterEllipsis" />
|
VerticalAlignment="Center"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
Text="{x:Bind Label, Mode=OneWay}"
|
||||||
|
TextTrimming="CharacterEllipsis" />
|
||||||
|
<InfoBadge
|
||||||
|
Margin="4,0,0,0"
|
||||||
|
Style="{StaticResource NewInfoBadge}"
|
||||||
|
Visibility="{x:Bind IsNew, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
<FontIcon
|
<FontIcon
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Width="20"
|
Width="20"
|
||||||
|
|
|
@ -110,6 +110,9 @@
|
||||||
x:Uid="Shell_TopLevelSystemTools"
|
x:Uid="Shell_TopLevelSystemTools"
|
||||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SystemTools.png}"
|
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SystemTools.png}"
|
||||||
SelectsOnInvoked="False">
|
SelectsOnInvoked="False">
|
||||||
|
<NavigationViewItem.InfoBadge>
|
||||||
|
<InfoBadge Style="{StaticResource NewInfoBadge}" />
|
||||||
|
</NavigationViewItem.InfoBadge>
|
||||||
<NavigationViewItem.MenuItems>
|
<NavigationViewItem.MenuItems>
|
||||||
<NavigationViewItem
|
<NavigationViewItem
|
||||||
x:Uid="Shell_AdvancedPaste"
|
x:Uid="Shell_AdvancedPaste"
|
||||||
|
@ -142,7 +145,11 @@
|
||||||
<NavigationViewItem
|
<NavigationViewItem
|
||||||
x:Uid="Shell_ZoomIt"
|
x:Uid="Shell_ZoomIt"
|
||||||
helpers:NavHelper.NavigateTo="views:ZoomItPage"
|
helpers:NavHelper.NavigateTo="views:ZoomItPage"
|
||||||
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/ZoomIt.png}" />
|
Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/ZoomIt.png}">
|
||||||
|
<NavigationViewItem.InfoBadge>
|
||||||
|
<InfoBadge Style="{StaticResource NewInfoBadge}" />
|
||||||
|
</NavigationViewItem.InfoBadge>
|
||||||
|
</NavigationViewItem>
|
||||||
</NavigationViewItem.MenuItems>
|
</NavigationViewItem.MenuItems>
|
||||||
</NavigationViewItem>
|
</NavigationViewItem>
|
||||||
|
|
||||||
|
|
|
@ -4880,4 +4880,8 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m
|
||||||
<data name="PowerLauncher_PluginWebsite.Text" xml:space="preserve">
|
<data name="PowerLauncher_PluginWebsite.Text" xml:space="preserve">
|
||||||
<value>Project website</value>
|
<value>Project website</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SettingsPage_NewInfoBadge.Text" xml:space="preserve">
|
||||||
|
<value>NEW</value>
|
||||||
|
<comment>Must be all caps</comment>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -20,6 +20,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||||
|
|
||||||
public string Label { get; set; }
|
public string Label { get; set; }
|
||||||
|
|
||||||
|
public bool IsNew { get; set; }
|
||||||
|
|
||||||
public string Icon { get; set; }
|
public string Icon { get; set; }
|
||||||
|
|
||||||
public string ToolTip { get; set; }
|
public string ToolTip { get; set; }
|
||||||
|
|
|
@ -74,6 +74,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
||||||
{
|
{
|
||||||
Tag = moduleType,
|
Tag = moduleType,
|
||||||
Label = resourceLoader.GetString(ModuleHelper.GetModuleLabelResourceName(moduleType)),
|
Label = resourceLoader.GetString(ModuleHelper.GetModuleLabelResourceName(moduleType)),
|
||||||
|
IsNew = moduleType == ModuleType.ZoomIt,
|
||||||
IsEnabled = gpo == GpoRuleConfigured.Enabled || (gpo != GpoRuleConfigured.Disabled && ModuleHelper.GetIsModuleEnabled(generalSettingsConfig, moduleType)),
|
IsEnabled = gpo == GpoRuleConfigured.Enabled || (gpo != GpoRuleConfigured.Disabled && ModuleHelper.GetIsModuleEnabled(generalSettingsConfig, moduleType)),
|
||||||
IsLocked = gpo == GpoRuleConfigured.Enabled || gpo == GpoRuleConfigured.Disabled,
|
IsLocked = gpo == GpoRuleConfigured.Enabled || gpo == GpoRuleConfigured.Disabled,
|
||||||
Icon = ModuleHelper.GetModuleTypeFluentIconName(moduleType),
|
Icon = ModuleHelper.GetModuleTypeFluentIconName(moduleType),
|
||||||
|
|
Загрузка…
Ссылка в новой задаче