From 318cb32d13bcb8b64c3c8d9750cd7b3af3d52a4c Mon Sep 17 00:00:00 2001 From: Kayla Cinnamon Date: Wed, 22 Jan 2025 13:12:46 -0500 Subject: [PATCH] [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 Co-authored-by: Jaime Bernardo --- .../Settings.UI/SettingsXAML/App.xaml | 1 + .../SettingsXAML/Styles/InfoBadge.xaml | 23 +++++++++++ .../SettingsXAML/Views/DashboardPage.xaml | 39 ++++++++++++++----- .../SettingsXAML/Views/ShellPage.xaml | 9 ++++- .../Settings.UI/Strings/en-us/Resources.resw | 4 ++ .../ViewModels/DashboardListItem.cs | 2 + .../ViewModels/DashboardViewModel.cs | 1 + 7 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 src/settings-ui/Settings.UI/SettingsXAML/Styles/InfoBadge.xaml diff --git a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml index 6e65f31069..365c592d27 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml @@ -11,6 +11,7 @@ + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Styles/InfoBadge.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Styles/InfoBadge.xaml new file mode 100644 index 0000000000..a4a5a26111 --- /dev/null +++ b/src/settings-ui/Settings.UI/SettingsXAML/Styles/InfoBadge.xaml @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml index 0e26afcaac..b48ddf66c8 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml @@ -348,17 +348,28 @@ - + - + Orientation="Horizontal"> + + + - + - + Orientation="Horizontal"> + + + + + + + Icon="{ui:BitmapIcon Source=/Assets/Settings/Icons/ZoomIt.png}"> + + + + diff --git a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw index 842e49ae99..b7c9b4ec68 100644 --- a/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw @@ -4880,4 +4880,8 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m Project website + + NEW + Must be all caps + \ No newline at end of file diff --git a/src/settings-ui/Settings.UI/ViewModels/DashboardListItem.cs b/src/settings-ui/Settings.UI/ViewModels/DashboardListItem.cs index 03843a8d8c..9e3110456b 100644 --- a/src/settings-ui/Settings.UI/ViewModels/DashboardListItem.cs +++ b/src/settings-ui/Settings.UI/ViewModels/DashboardListItem.cs @@ -20,6 +20,8 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels public string Label { get; set; } + public bool IsNew { get; set; } + public string Icon { get; set; } public string ToolTip { get; set; } diff --git a/src/settings-ui/Settings.UI/ViewModels/DashboardViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/DashboardViewModel.cs index e2b0762288..ca5de48f5d 100644 --- a/src/settings-ui/Settings.UI/ViewModels/DashboardViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/DashboardViewModel.cs @@ -74,6 +74,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels { Tag = moduleType, Label = resourceLoader.GetString(ModuleHelper.GetModuleLabelResourceName(moduleType)), + IsNew = moduleType == ModuleType.ZoomIt, IsEnabled = gpo == GpoRuleConfigured.Enabled || (gpo != GpoRuleConfigured.Disabled && ModuleHelper.GetIsModuleEnabled(generalSettingsConfig, moduleType)), IsLocked = gpo == GpoRuleConfigured.Enabled || gpo == GpoRuleConfigured.Disabled, Icon = ModuleHelper.GetModuleTypeFluentIconName(moduleType),