From 370e8c8574e6b5daff3e38ce75d33d8218548a13 Mon Sep 17 00:00:00 2001 From: Niels Laute Date: Mon, 5 Jul 2021 16:25:23 +0200 Subject: [PATCH] [Settings] Aligning XAML across all pages (#12212) * Updating settings * OOBE button * Removed unused namespaces Co-authored-by: Niels Laute --- .../SidePanel/SettingsPageControl.xaml | 117 +++++++ .../SidePanel/SettingsPageControl.xaml.cs | 88 +++++ .../Controls/SidePanel/SidePanelLink.cs | 15 + .../Microsoft.PowerToys.Settings.UI.csproj | 8 + .../Strings/en-us/Resources.resw | 127 ++----- .../Views/AwakePage.xaml | 163 +++------ .../Views/ColorPickerPage.xaml | 111 +----- .../Views/FancyZonesPage.xaml | 99 +----- .../Views/GeneralPage.xaml | 322 +++++++----------- .../Views/ImageResizerPage.xaml | 305 +++++++---------- .../Views/KeyboardManagerPage.xaml | 129 ++----- .../Views/PowerLauncherPage.xaml | 114 ++----- .../Views/PowerPreviewPage.xaml | 90 +---- .../Views/PowerRenamePage.xaml | 119 ++----- .../Views/ShortcutGuidePage.xaml | 149 +++----- .../Views/VideoConference.xaml | 159 +++------ 16 files changed, 758 insertions(+), 1357 deletions(-) create mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml create mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml.cs create mode 100644 src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SidePanelLink.cs diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml new file mode 100644 index 0000000000..c1ec4c9bea --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml.cs new file mode 100644 index 0000000000..b8a74f24f3 --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SettingsPageControl.xaml.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +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.Documents; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public sealed partial class SettingsPageControl : UserControl + { + public SettingsPageControl() + { + this.InitializeComponent(); + ModuleLinks = new ObservableCollection(); + AttributionLinks = new ObservableCollection(); + } + + public object ModuleContent + { + get { return (object)GetValue(ModuleContentProperty); } + set { SetValue(ModuleContentProperty, value); } + } + + public static readonly DependencyProperty ModuleContentProperty = DependencyProperty.Register("Content", typeof(object), typeof(SettingsPageControl), new PropertyMetadata(new Grid())); + + public string ModuleTitle + { + get => (string)GetValue(ModuleTitleProperty); + set => SetValue(ModuleTitleProperty, value); + } + + public string ModuleDescription + { + get => (string)GetValue(ModuleDescriptionProperty); + set => SetValue(ModuleDescriptionProperty, value); + } + + public string ModuleImageSource + { + get => (string)GetValue(ModuleImageSourceProperty); + set => SetValue(ModuleImageSourceProperty, value); + } + + public Uri ModuleImageLink + { + get => (Uri)GetValue(ModuleImageLinkProperty); + set => SetValue(ModuleImageLinkProperty, value); + } + +#pragma warning disable CA2227 // Collection properties should be read only + public ObservableCollection ModuleLinks +#pragma warning restore CA2227 // Collection properties should be read only + { + get => (ObservableCollection)GetValue(ModuleLinksProperty); + set => SetValue(ModuleLinksProperty, value); + } + +#pragma warning disable CA2227 // Collection properties should be read only + public ObservableCollection AttributionLinks +#pragma warning restore CA2227 // Collection properties should be read only + { + get => (ObservableCollection)GetValue(AttributionLinksProperty); + set => SetValue(AttributionLinksProperty, value); + } + + public static readonly DependencyProperty ModuleTitleProperty = DependencyProperty.Register("ModuleTitle", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string))); + public static readonly DependencyProperty ModuleDescriptionProperty = DependencyProperty.Register("ModuleDescription", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string))); + public static readonly DependencyProperty ModuleImageSourceProperty = DependencyProperty.Register("ModuleImageSource", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string))); + public static readonly DependencyProperty ModuleImageLinkProperty = DependencyProperty.Register("ModuleImageLink", typeof(string), typeof(SettingsPageControl), new PropertyMetadata(default(string))); + public static readonly DependencyProperty ModuleLinksProperty = DependencyProperty.Register("ModuleLinks", typeof(ObservableCollection), typeof(SettingsPageControl), new PropertyMetadata(new ObservableCollection())); + public static readonly DependencyProperty AttributionLinksProperty = DependencyProperty.Register("AttributionLinks", typeof(ObservableCollection), typeof(SettingsPageControl), new PropertyMetadata(new ObservableCollection())); + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SidePanelLink.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SidePanelLink.cs new file mode 100644 index 0000000000..02fe99db55 --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SidePanel/SidePanelLink.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public class SidePanelLink + { + public string Label { get; set; } + + public Uri Link { get; set; } + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj index 14218107ca..ef9685a01d 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Microsoft.PowerToys.Settings.UI.csproj @@ -105,6 +105,10 @@ ShortcutVisualControl.xaml + + SettingsPageControl.xaml + + @@ -312,6 +316,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw index f107d8066a..83548cb101 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Strings/en-us/Resources.resw @@ -124,7 +124,7 @@ Enable Video Conference - + Video Conference Mute is a quick and easy way to do an global "mute" of both your microphone and webcam. Disabling this module or closing PowerToys will unmute the microphone and camera. @@ -185,7 +185,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Hide toolbar when both camera and microphone are unmuted - + About Video Conference @@ -253,7 +253,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Current configuration Keyboard Manager current configuration header - + Reconfigure your keyboard by remapping keys and shortcuts. Keyboard Manager page description @@ -311,7 +311,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Keyboard Manager do not loc, product name - + Quick and simple system-wide color picker. @@ -325,7 +325,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Activate Color Picker do not loc product name - + A quick launcher that has additional capabilities without sacrificing performance. @@ -394,17 +394,14 @@ Disabling this module or closing PowerToys will unmute the microphone and camera To: Keyboard Manager mapping keys view right header - - About this feature - Appearance - + FancyZones windows do not loc the Product name - + Create window layouts to help make multi-tasking easy. windows refers to application windows @@ -476,10 +473,10 @@ Disabling this module or closing PowerToys will unmute the microphone and camera During zone layout changes, windows assigned to a zone will match new size/positions - + Give feedback - + Learn more This label is there to point people to additional overview for how to use the product @@ -487,26 +484,23 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Attribution giving credit to the projects this utility was based on - + About PowerToys - - PowerToys Icon - Check for updates Update now - + Privacy statement - + Report a bug Report an issue inside powertoys - + Request a feature Tell our team what we should build @@ -517,7 +511,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Run at startup - + A Windows Shell extension for more advanced bulk renaming using search and replace or regular expressions. @@ -555,13 +549,13 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Enable SVG (.svg) thumbnails Do you want this feature on / off - + These settings allow you to manage your Windows File Explorer custom preview handlers. Autocomplete - + Open-source notice @@ -573,7 +567,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Zone inactive color - + Shows a help overlay with Windows shortcuts when the Windows key is pressed. @@ -603,7 +597,7 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Image sizes - + Lets you resize images by right-clicking. @@ -759,36 +753,32 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Running as administrator - + About FancyZones - + About File Explorer File Explorer Use same translation as Windows does for File Explorer - + About Image Resizer - + About Keyboard Manager - + About Color Picker - - Color Picker - do not loc the Product name. - - + About PowerToys Run PowerToys Run - + About PowerRename do not loc the product name @@ -796,13 +786,13 @@ Disabling this module or closing PowerToys will unmute the microphone and camera PowerRename do not loc - + About Shortcut Guide Shortcut Guide - + GitHub repository @@ -851,8 +841,10 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Remap shortcuts to other shortcuts or keys. Additionally, mappings can be targeted to specific applications as well. - - Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. + + Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. + +Made with 💗 by Microsoft and the PowerToys community. Windows refers to the OS @@ -1000,50 +992,6 @@ Disabling this module or closing PowerToys will unmute the microphone and camera Small The size of the image - - https://aka.ms/PowerToysOverview_ColorPicker - URL. Do not loc - - - https://aka.ms/PowerToysOverview_Awake - URL. Do not loc - - - https://aka.ms/PowerToysOverview_FancyZones - URL. Do not loc - - - https://aka.ms/powertoys - URL. Do not loc - - - https://aka.ms/PowerToysOverview_ImageResizer - URL. Do not loc - - - https://aka.ms/PowerToysOverview_FileExplorerAddOns - URL. Do not loc - - - https://aka.ms/PowerToysOverview_KeyboardManager - URL. Do not loc - - - https://aka.ms/PowerToysOverview_PowerRename - URL. Do not loc - - - https://aka.ms/PowerToysOverview_PowerToysRun - URL. Do not loc - - - https://aka.ms/PowerToysOverview_ShortcutGuide - URL. Do not loc - - - https://aka.ms/PowerToysOverview_VideoConference - URL. Do not loc - Win + Up/Down/Left/Right to move windows based on relative position @@ -1308,10 +1256,10 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and PowerToys Settings - + About Awake - + A convenient way to keep your PC awake on-demand. @@ -1350,13 +1298,6 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and Minutes - - Den Delimarsky's Awake - - - https://Awake.den.dev - URL. Do not loc - Awake Module name, do not loc @@ -1400,4 +1341,4 @@ From there, simply click on a Markdown file or SVG icon in the File Explorer and Download and install - + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml index b6793d6e35..806e87f377 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml @@ -5,10 +5,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 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" mc:Ignorable="d" - d:DesignHeight="300" - d:DesignWidth="400" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" AutomationProperties.LandmarkType="Main"> @@ -16,104 +14,71 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - + + - - - - + + + - - + + - - - - + + + - - + + - - - + + + - - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml index 1cea6a7622..c172141883 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml @@ -2,51 +2,19 @@ x:Class="Microsoft.PowerToys.Settings.UI.Views.ColorPickerPage" 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.Views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:Custom="using:Microsoft.PowerToys.Settings.UI.Controls" - xmlns:Color="using:Microsoft.PowerToys.Settings.UI.Library.ViewModels" xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core" + xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" + xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" + xmlns:Core="using:Microsoft.Xaml.Interactions.Core" mc:Ignorable="d" - d:DesignHeight="300" - d:DesignWidth="400" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" AutomationProperties.LandmarkType="Main"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml index 45a130cce1..87e1ca74f2 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml @@ -2,15 +2,11 @@ x:Class="Microsoft.PowerToys.Settings.UI.Views.FancyZonesPage" 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.Views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.ViewModels" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls" - xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" - xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" - xmlns:Core="using:Microsoft.Xaml.Interactions.Core" + xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" + xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" AutomationProperties.LandmarkType="Main"> @@ -19,46 +15,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + @@ -82,7 +43,7 @@ - - - - - - + + - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/GeneralPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/GeneralPage.xaml index 041d814988..dd5b19bcd3 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/GeneralPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/GeneralPage.xaml @@ -2,12 +2,11 @@ x:Class="Microsoft.PowerToys.Settings.UI.Views.GeneralPage" 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.Views" + xmlns:controls="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:converters="using:Microsoft.Toolkit.Uwp.UI.Converters" xmlns:localConverters="using:Microsoft.PowerToys.Settings.UI.Converters" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" AutomationProperties.LandmarkType="Main"> @@ -21,334 +20,261 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - + + + + + + + + - - + - + - - - - - - - - - + + + + + + + - - - - - - + + + + - - - - - - - - - + + + + + + + + - - - - - + + - - - - - + + + + @@ -329,61 +293,24 @@ - - - + + + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/KeyboardManagerPage.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/KeyboardManagerPage.xaml index 84eb018952..a21fac9b67 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/KeyboardManagerPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/KeyboardManagerPage.xaml @@ -5,9 +5,8 @@ xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModel="using:Microsoft.PowerToys.Settings.UI.Library.ViewModels" xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions" - xmlns:CustomControls="using:Microsoft.PowerToys.Settings.UI.Controls" + xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:Lib="using:Microsoft.PowerToys.Settings.UI.Library" mc:Ignorable="d" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" @@ -189,54 +188,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - -