diff --git a/src/settings-ui/Settings.UI/PowerToys.Settings.csproj b/src/settings-ui/Settings.UI/PowerToys.Settings.csproj index a6751adb98..dade6a194c 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 f63ccdf3a6..54b1e1a02f 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 bc46c9d17e..719091a787 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 c3829e3984..7e4d31c28b 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 @@ namespace Microsoft.PowerToys.Settings.UI.Controls 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 @@ namespace Microsoft.PowerToys.Settings.UI.Controls } } } - } - 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 93adc2daf9..2ff188e76d 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/ZoomItPage.xaml @@ -15,6 +15,25 @@ + + + - + HeaderIcon="{ui:FontIcon Glyph=}" + IsExpanded="True"> - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + + + + + + - + HeaderIcon="{ui:FontIcon Glyph=}" + IsExpanded="True"> - + + + + + + + + - - + + - +