mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[CmdPal] Settings UI polishing (#38094)
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request Settings window UI polishing: - Make the navigation view toggle button move in the title bar when navigation view mode is compact or minimal - Center settings card in the window - Properly set windows icon in order to make it visible in task manager and task view _main branch_   _PR_   <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [ ] **Closes:**: https://github.com/zadjii-msft/PowerToys/issues/581 --------- Co-authored-by: Niels Laute <niels.laute@live.nl>
This commit is contained in:
committed by
GitHub
parent
4e7bd34c4d
commit
a9a41ca1a2
@@ -4,6 +4,7 @@
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Microsoft.CmdPal.UI.Helpers;
|
||||
using Microsoft.CmdPal.UI.ViewModels;
|
||||
using Microsoft.CmdPal.UI.ViewModels.Messages;
|
||||
using Microsoft.UI.Windowing;
|
||||
@@ -24,7 +25,7 @@ public sealed partial class SettingsWindow : Window,
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.ExtendsContentIntoTitleBar = true;
|
||||
this.AppWindow.SetIcon("ms-appx:///Assets/Icons/StoreLogo.png");
|
||||
this.SetIcon();
|
||||
this.AppWindow.Title = RS_.GetString("SettingsWindowTitle");
|
||||
this.AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
|
||||
PositionCentered();
|
||||
@@ -110,6 +111,27 @@ public sealed partial class SettingsWindow : Window,
|
||||
WeakReferenceMessenger.Default.Send<SettingsWindowClosedMessage>();
|
||||
}
|
||||
|
||||
private void PaneToggleBtn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
NavView.IsPaneOpen = !NavView.IsPaneOpen;
|
||||
}
|
||||
|
||||
private void NavView_DisplayModeChanged(NavigationView sender, NavigationViewDisplayModeChangedEventArgs args)
|
||||
{
|
||||
if (args.DisplayMode == NavigationViewDisplayMode.Compact || args.DisplayMode == NavigationViewDisplayMode.Minimal)
|
||||
{
|
||||
PaneToggleBtn.Visibility = Visibility.Visible;
|
||||
NavView.IsPaneToggleButtonVisible = false;
|
||||
AppTitleBar.Margin = new Thickness(48, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PaneToggleBtn.Visibility = Visibility.Collapsed;
|
||||
NavView.IsPaneToggleButtonVisible = true;
|
||||
AppTitleBar.Margin = new Thickness(16, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void Receive(QuitMessage message)
|
||||
{
|
||||
// This might come in on a background thread
|
||||
|
||||
Reference in New Issue
Block a user