Updates to titlebar

This commit is contained in:
Laute 2021-11-20 16:16:08 +01:00
parent e6c6a8a046
commit c4a0364d57
2 changed files with 6 additions and 8 deletions

View file

@ -12,12 +12,10 @@
<RowDefinition Height="36"/>
<RowDefinition Height="*" />
</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>
<StackPanel x:Name="CustomTitleBar" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<Image Source="ms-appx:///Assets/FluentIcons/FluentIconsPowerToys.png" Width="16" />
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Margin="12,0,0,0" Text="PowerToys" />
</StackPanel>
<local:ShellPage Grid.Row="1"/>
</Grid>
</Window>

View file

@ -19,8 +19,8 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3
public MainWindow()
{
this.InitializeComponent();
this.ExtendsContentIntoTitleBar = true;
this.SetTitleBar(CustomTitleBar); // This should work according to docs, but it doesn't.... So disabling for now together with ExtendsContentIntoTitleBar
ExtendsContentIntoTitleBar = true;
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 =>