diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/App.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/App.xaml index 72d9ffa111..c32a5ba54e 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/App.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/App.xaml @@ -17,9 +17,8 @@ - - + 6,16,16,16 16,0,0,0 @@ -28,7 +27,7 @@ @@ -63,13 +62,6 @@ - - - - - - - \ No newline at end of file diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.cs new file mode 100644 index 0000000000..181f93a1ae --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.cs @@ -0,0 +1,21 @@ +// 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.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.UI.Xaml.Controls; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + public class SettingExpander : Expander + { + public SettingExpander() + { + DefaultStyleKey = typeof(SettingExpander); + } + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.xaml new file mode 100644 index 0000000000..682dbbd063 --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingExpander/SettingExpander.xaml @@ -0,0 +1,15 @@ + + + + + diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.cs b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.cs new file mode 100644 index 0000000000..8625b05b99 --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.cs @@ -0,0 +1,59 @@ +// 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.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +namespace Microsoft.PowerToys.Settings.UI.Controls +{ + /// + /// Represents a control that can contain multiple settings (or other) controls + /// + [TemplateVisualState(Name = "Normal", GroupName = "CommonStates")] + [TemplateVisualState(Name = "Disabled", GroupName = "CommonStates")] + public partial class SettingsGroup : ItemsControl + { + public SettingsGroup() + { + DefaultStyleKey = typeof(SettingsGroup); + } + + public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( + "Header", + typeof(string), + typeof(SettingsGroup), + new PropertyMetadata(default(string))); + + [Localizable(true)] + public string Header + { + get => (string)GetValue(HeaderProperty); + set => SetValue(HeaderProperty, value); + } + + protected override void OnApplyTemplate() + { + IsEnabledChanged -= SettingsGroup_IsEnabledChanged; + SetEnabledState(); + IsEnabledChanged += SettingsGroup_IsEnabledChanged; + base.OnApplyTemplate(); + } + + private void SettingsGroup_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) + { + SetEnabledState(); + } + + private void SetEnabledState() + { + VisualStateManager.GoToState(this, IsEnabled ? "Normal" : "Disabled", true); + } + } +} diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.xaml new file mode 100644 index 0000000000..80c7b66e9f --- /dev/null +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Controls/SettingsGroup/SettingsGroup.xaml @@ -0,0 +1,44 @@ + + + + \ No newline at end of file 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 e6adfa775e..7b772038ae 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 @@ -99,6 +99,8 @@ HotkeySettingsControl.xaml + + ShortcutTextControl.xaml @@ -311,6 +313,14 @@ Designer MSBuild:Compile + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + Designer MSBuild:Compile @@ -407,10 +417,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - MSBuild:Compile Designer diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/Generic.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/Generic.xaml index f387296dfc..0760974b1f 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/Generic.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/Generic.xaml @@ -4,5 +4,7 @@ + + diff --git a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/SettingsSectionStyles.xaml b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/SettingsSectionStyles.xaml deleted file mode 100644 index 72d7f4e806..0000000000 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Themes/SettingsSectionStyles.xaml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - 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 e00ff2c8e1..12c3287c4b 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/AwakePage.xaml @@ -33,7 +33,7 @@ - + @@ -105,7 +105,7 @@ - + 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 e62ac3d459..865f2018fd 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/ColorPickerPage.xaml @@ -6,9 +6,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls" xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" - xmlns:Core="using:Microsoft.Xaml.Interactions.Core" - xmlns:toolkitcontrols="using:Microsoft.Toolkit.Uwp.UI.Controls" mc:Ignorable="d" AutomationProperties.LandmarkType="Main"> @@ -29,7 +26,7 @@ - + @@ -41,8 +38,8 @@ - - + + @@ -83,7 +80,7 @@ - + @@ -115,9 +112,9 @@ Margin="{StaticResource SmallTopMargin}" IsEnabled="{Binding IsEnabled}"/> --> - + - + @@ -198,7 +195,7 @@ - + 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 dc6ae4e95d..cbc79c09bd 100644 --- a/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml +++ b/src/settings-ui/Microsoft.PowerToys.Settings.UI/Views/FancyZonesPage.xaml @@ -19,9 +19,17 @@ ModuleImageLink="https://aka.ms/PowerToysOverview_FancyZones"> - + + + + + + + + + + + @@ -34,7 +33,7 @@ - +