diff --git a/src/settings-ui/QuickAccess.UI/QuickAccessXAML/Flyout/AppsListPage.xaml b/src/settings-ui/QuickAccess.UI/QuickAccessXAML/Flyout/AppsListPage.xaml index ffa3cfbb93..1011f021f3 100644 --- a/src/settings-ui/QuickAccess.UI/QuickAccessXAML/Flyout/AppsListPage.xaml +++ b/src/settings-ui/QuickAccess.UI/QuickAccessXAML/Flyout/AppsListPage.xaml @@ -29,12 +29,13 @@ - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/src/settings-ui/Settings.UI.Controls/ModuleList/ModuleList.xaml.cs b/src/settings-ui/Settings.UI.Controls/ModuleList/ModuleList.xaml.cs index f33cd64ec7..f9d36a7e69 100644 --- a/src/settings-ui/Settings.UI.Controls/ModuleList/ModuleList.xaml.cs +++ b/src/settings-ui/Settings.UI.Controls/ModuleList/ModuleList.xaml.cs @@ -9,15 +9,19 @@ namespace Microsoft.PowerToys.Settings.UI.Controls { public sealed partial class ModuleList : UserControl { - private object? _sortButton; - public ModuleList() { this.InitializeComponent(); - _sortButton = ModulesCard.TitleContent; - UpdateHeaderVisibility(); } + public Thickness DividerThickness + { + get => (Thickness)GetValue(DividerThicknessProperty); + set => SetValue(DividerThicknessProperty, value); + } + + public static readonly DependencyProperty DividerThicknessProperty = DependencyProperty.Register(nameof(DividerThickness), typeof(Thickness), typeof(ModuleList), new PropertyMetadata(new Thickness(0, 1, 0, 0))); + public bool IsItemClickable { get => (bool)GetValue(IsItemClickableProperty); @@ -42,46 +46,6 @@ namespace Microsoft.PowerToys.Settings.UI.Controls public static readonly DependencyProperty SortOptionProperty = DependencyProperty.Register(nameof(SortOption), typeof(ModuleListSortOption), typeof(ModuleList), new PropertyMetadata(ModuleListSortOption.Alphabetical)); - public string Title - { - get => (string)GetValue(TitleProperty); - set => SetValue(TitleProperty, value); - } - - public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof(Title), typeof(string), typeof(ModuleList), new PropertyMetadata(default(string), OnTitleChanged)); - - private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ((ModuleList)d).UpdateHeaderVisibility(); - } - - private void UpdateHeaderVisibility() - { - if (ModulesCard == null) - { - return; - } - - if (string.IsNullOrEmpty(Title)) - { - ModulesCard.TitleContent = null; - } - else - { - ModulesCard.TitleContent = _sortButton; - } - } - - private void SortAlphabetical_Click(object sender, RoutedEventArgs e) - { - SortOption = ModuleListSortOption.Alphabetical; - } - - private void SortByStatus_Click(object sender, RoutedEventArgs e) - { - SortOption = ModuleListSortOption.ByStatus; - } - private void OnSettingsCardClick(object sender, RoutedEventArgs e) { if (sender is FrameworkElement element && element.Tag is ModuleListItem item) diff --git a/src/settings-ui/Settings.UI.Controls/Primitives/Card.xaml.cs b/src/settings-ui/Settings.UI.Controls/Primitives/Card.xaml.cs index 5f7339e8c7..ebf04c4e89 100644 --- a/src/settings-ui/Settings.UI.Controls/Primitives/Card.xaml.cs +++ b/src/settings-ui/Settings.UI.Controls/Primitives/Card.xaml.cs @@ -34,7 +34,7 @@ namespace Microsoft.PowerToys.Settings.UI.Controls set => SetValue(ContentProperty, value); } - public static readonly DependencyProperty DividerVisibilityProperty = DependencyProperty.Register(nameof(DividerVisibility), typeof(Visibility), typeof(Card), new PropertyMetadata(defaultValue: null)); + public static readonly DependencyProperty DividerVisibilityProperty = DependencyProperty.Register(nameof(DividerVisibility), typeof(Visibility), typeof(Card), new PropertyMetadata(defaultValue: Visibility.Visible)); public Visibility DividerVisibility { @@ -66,7 +66,6 @@ namespace Microsoft.PowerToys.Settings.UI.Controls else { VisualStateManager.GoToState(this, "TitleGridVisible", true); - DividerVisibility = Visibility.Visible; } } } diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml index 03928adee5..745cddb22b 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml @@ -224,14 +224,46 @@ Visibility="{x:Bind ViewModel.ShortcutModules.Count, Mode=OneWay, Converter={StaticResource DoubleToInvertedVisibilityConverter}}" /> - + DividerVisibility="Collapsed"> + + + + + diff --git a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml.cs index 48ca759ce5..619b8ab4ba 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/Views/DashboardPage.xaml.cs @@ -61,5 +61,15 @@ namespace Microsoft.PowerToys.Settings.UI.Views App.GetOobeWindow().Activate(); } + + private void SortAlphabetical_Click(object sender, RoutedEventArgs e) + { + ViewModel.DashboardSortOrder = DashboardSortOrder.Alphabetical; + } + + private void SortByStatus_Click(object sender, RoutedEventArgs e) + { + ViewModel.DashboardSortOrder = DashboardSortOrder.ByStatus; + } } }