diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index f649476f603f..ca2d7f159b01 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -224,7 +224,6 @@ clientside CLIPBOARDUPDATE CLIPCHILDREN CLIPSIBLINGS -CLITo closesocket clp CLSCTX @@ -325,7 +324,6 @@ CUSTOMFORMATPLACEHOLDER CVal cvd CVirtual -CVS CWMO CXSCREEN CXSMICON @@ -733,9 +731,9 @@ HWNDPARENT HWNDPREV hyjiacan IAI +icf ICONERROR ICONLOCATION -icf IDCANCEL IDD idk @@ -1062,9 +1060,9 @@ MSLLHOOKSTRUCT Mso msrc msstore +mstsc msvcp MT -mstsc MTND MULTIPLEUSE multizone @@ -1078,7 +1076,6 @@ MVVMTK MWBEx MYICON NAMECHANGE -Notavailable namespaceanddescendants nao NCACTIVATE @@ -1219,8 +1216,6 @@ OPENFILENAME openrdp opensource openxmlformats -ollama -onnx OPTIMIZEFORINVOKE ORPHANEDDIALOGTITLE ORSCANS @@ -1433,7 +1428,6 @@ RAWPATH rbhid rclsid RCZOOMIT -remotedesktop rdp RDW READMODE @@ -1462,6 +1456,7 @@ remappings REMAPSUCCESSFUL REMAPUNSUCCESSFUL Remotable +remotedesktop remoteip Removelnk renamable @@ -1805,7 +1800,6 @@ tlbimp tlc tmain TNP -toolgood Toolhelp toolwindow TOPDOWNDIB @@ -1853,9 +1847,9 @@ uild uitests UITo ULONGLONG -ums UMax UMin +ums uncompilable UNCPRIORITY UNDNAME @@ -1867,7 +1861,6 @@ Uniquifies unitconverter unittests UNLEN -Uninitializes UNORM unremapped Unsubscribes @@ -1955,7 +1948,7 @@ vswhere Vtbl WANTNUKEWARNING WANTPALM -wasdk +WASDK wbem WBounds Wca diff --git a/src/settings-ui/Settings.UI/Converters/HotkeySettingsToLocalizedStringConverter.cs b/src/settings-ui/Settings.UI/Converters/HotkeySettingsToLocalizedStringConverter.cs new file mode 100644 index 000000000000..c092525c7553 --- /dev/null +++ b/src/settings-ui/Settings.UI/Converters/HotkeySettingsToLocalizedStringConverter.cs @@ -0,0 +1,31 @@ +// 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.Windows; +using Microsoft.PowerToys.Settings.UI.Helpers; +using Microsoft.PowerToys.Settings.UI.Library; +using Microsoft.UI.Xaml.Data; +using Microsoft.Windows.ApplicationModel.Resources; + +namespace Microsoft.PowerToys.Settings.UI.Converters +{ + public partial class HotkeySettingsToLocalizedStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + if (value is HotkeySettings keySettings && parameter is string resourceKey) + { + return string.Format(System.Globalization.CultureInfo.CurrentCulture, ResourceLoaderInstance.ResourceLoader.GetString(resourceKey), keySettings.ToString()); + } + + return string.Empty; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj index a6751adb989d..dade6a194cbf 100644 --- a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj +++ b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj @@ -175,6 +175,9 @@ Always + + MSBuild:Compile + MSBuild:Compile diff --git a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml index f63ccdf3a64a..54b1e1a02f39 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:converters="using:Microsoft.PowerToys.Settings.UI.Converters" + xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls" xmlns:tkconverters="using:CommunityToolkit.WinUI.Converters"> @@ -18,7 +19,7 @@ - + @@ -81,9 +82,6 @@ - - - diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml index bc46c9d17ef7..719091a78782 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml @@ -1,58 +1,67 @@ - + + xmlns:local="using:Microsoft.PowerToys.Settings.UI.Controls" + xmlns:tk="using:CommunityToolkit.WinUI" + xmlns:tkcontrols="using:CommunityToolkit.WinUI.Controls"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml.cs index c3829e3984e4..7e4d31c28b9c 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Controls/ShortcutControl/ShortcutWithTextLabelControl.xaml.cs @@ -1,15 +1,15 @@ -// Copyright (c) Microsoft Corporation +// 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.Collections.Generic; - +using CommunityToolkit.WinUI.Controls; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; namespace Microsoft.PowerToys.Settings.UI.Controls { - public sealed partial class ShortcutWithTextLabelControl : UserControl + public sealed partial class ShortcutWithTextLabelControl : Control { public string Text { @@ -27,26 +27,47 @@ public List Keys public static readonly DependencyProperty KeysProperty = DependencyProperty.Register(nameof(Keys), typeof(List), typeof(ShortcutWithTextLabelControl), new PropertyMetadata(default(string))); - public LabelPlacement LabelPlacement + public Placement LabelPlacement { - get { return (LabelPlacement)GetValue(LabelPlacementProperty); } + get { return (Placement)GetValue(LabelPlacementProperty); } set { SetValue(LabelPlacementProperty, value); } } - public static readonly DependencyProperty LabelPlacementProperty = DependencyProperty.Register(nameof(LabelPlacement), typeof(LabelPlacement), typeof(ShortcutWithTextLabelControl), new PropertyMetadata(defaultValue: LabelPlacement.After, OnIsLabelPlacementChanged)); + public static readonly DependencyProperty LabelPlacementProperty = DependencyProperty.Register(nameof(LabelPlacement), typeof(Placement), typeof(ShortcutWithTextLabelControl), new PropertyMetadata(defaultValue: Placement.After, OnIsLabelPlacementChanged)); + + public MarkdownConfig MarkdownConfig + { + get { return (MarkdownConfig)GetValue(MarkdownConfigProperty); } + set { SetValue(MarkdownConfigProperty, value); } + } + + public static readonly DependencyProperty MarkdownConfigProperty = DependencyProperty.Register(nameof(MarkdownConfig), typeof(MarkdownConfig), typeof(ShortcutWithTextLabelControl), new PropertyMetadata(new MarkdownConfig())); + + public Style KeyVisualStyle + { + get { return (Style)GetValue(KeyVisualStyleProperty); } + set { SetValue(KeyVisualStyleProperty, value); } + } + + public static readonly DependencyProperty KeyVisualStyleProperty = DependencyProperty.Register(nameof(KeyVisualStyle), typeof(Style), typeof(ShortcutWithTextLabelControl), new PropertyMetadata(default(Style))); public ShortcutWithTextLabelControl() { - this.InitializeComponent(); + DefaultStyleKey = typeof(ShortcutWithTextLabelControl); + } + + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); } private static void OnIsLabelPlacementChanged(DependencyObject d, DependencyPropertyChangedEventArgs newValue) { if (d is ShortcutWithTextLabelControl labelControl) { - if (labelControl.LabelPlacement == LabelPlacement.Before) + if (labelControl.LabelPlacement == Placement.Before) { - VisualStateManager.GoToState(labelControl, "LabelBefore", true); + VisualStateManager.GoToState(labelControl, "LabelBefore", true); } else { @@ -54,11 +75,11 @@ private static void OnIsLabelPlacementChanged(DependencyObject d, DependencyProp } } } - } - public enum LabelPlacement - { - Before, - After, + public enum Placement + { + Before, + After, + } } } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml index 80adbcc5903e..3f672daaa48f 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml @@ -11,12 +11,20 @@ xmlns:ui="using:CommunityToolkit.WinUI" AutomationProperties.LandmarkType="Main" mc:Ignorable="d"> - + + + - - - + HeaderIcon="{ui:FontIcon Glyph=}" + IsExpanded="True"> - - - - - - - - - - + + + + + + + + + + + + + + + + + - + HeaderIcon="{ui:FontIcon Glyph=}" + IsExpanded="True"> - + + + + + + + + - + HeaderIcon="{ui:FontIcon Glyph=}" + IsExpanded="True"> - + + + + + + + + - - + + - +