Updated titlebar

This commit is contained in:
Laute 2021-11-12 10:01:32 +01:00
parent 24474f82a9
commit c49d41d6a8
5 changed files with 17 additions and 11 deletions

View file

@ -15,6 +15,11 @@
<ResourceDictionary Source="/Themes/SettingsExpanderStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="WindowCaptionBackground">Green</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">LightGreen</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionForeground">Red</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionForegroundDisabled">Pink</SolidColorBrush>
<Thickness x:Key="InfoBarIconMargin">6,16,16,16</Thickness>
<Thickness x:Key="InfoBarContentRootPadding">16,0,0,0</Thickness>
<x:Double x:Key="SettingActionControlMinWidth">240</x:Double>

View file

@ -63,11 +63,13 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
private MainWindow m_window;
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
{
m_window = new MainWindow();
//m_window.ExtendsContentIntoTitleBar = true;
//m_window.SetTitleBar(m_window.CustomTitleBar); // This should work according to docs, but it doesn't.... So disabling for now together with ExtendsContentIntoTitleBar
m_window.ExtendsContentIntoTitleBar = true;
m_window.Title = "PowerToys Settings";
m_window.Activate();
@ -144,7 +146,6 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3
return selectedTheme == "DARK" || (selectedTheme == "SYSTEM" && uiTheme == "#FF000000");
}
private MainWindow m_window;
private static ISettingsUtils settingsUtils = new SettingsUtils();
}
}

View file

@ -7,17 +7,17 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<!--<Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>-->
<!--<Grid x:Name="CustomTitleBar" HorizontalAlignment="Stretch">
</Grid.RowDefinitions>
<Grid x:Name="CustomTitleBar" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" VerticalAlignment="Top" Margin="16,8,8,8">
<Image Source="ms-appx:///Assets/FluentIcons/FluentIconsPowerToys.png" Width="16" />
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Margin="12,0,0,0" Text="PowerToys" />
</StackPanel>
</Grid>-->
</Grid>
<local:ShellPage Grid.Row="1" x:Name="shellPage"/>
</Grid>
</Window>

View file

@ -17,6 +17,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3
public MainWindow()
{
this.InitializeComponent();
this.SetTitleBar(CustomTitleBar); // This should work according to docs, but it doesn't.... So disabling for now together with ExtendsContentIntoTitleBar
// send IPC Message
ShellPage.SetDefaultSndMessageCallback(msg =>

View file

@ -18,8 +18,7 @@
</ic:EventTriggerBehavior>
</i:Interaction.Behaviors>
<Grid x:Name="RootGrid"
>
<Grid x:Name="RootGrid">
<muxc:NavigationView x:Name="navigationView"
IsBackButtonVisible="Collapsed"