Fix Windows 11 titlebars (#92)

also fixed the fluent style not changing the taskbar icon
This commit is contained in:
pizzaboxer 2023-02-18 22:27:32 +00:00
parent 9a90488575
commit 467f55c4b2
3 changed files with 10 additions and 18 deletions

View File

@ -7,9 +7,9 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
Width="420"
Height="178"
MinHeight="178"
MaxHeight="178"
Height="192"
MinHeight="191"
MaxHeight="192"
ResizeMode="NoResize"
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
ExtendsContentIntoTitleBar="True"
@ -17,7 +17,7 @@
WindowCornerPreference="Round"
WindowStartupLocation="CenterScreen">
<StackPanel>
<TextBlock Margin="16,16,8,0" Text="Bloxstrap" Foreground="{DynamicResource TextFillColorPrimaryBrush}" />
<ui:TitleBar Background="{ui:ThemeResource ApplicationBackgroundBrush}" Padding="15,15,0,10" x:Name="RootTitleBar" Grid.Row="0" ForceShutdown="False" MinimizeToTray="False" ShowHelp="False" UseSnapLayout="False" ShowClose="False" ShowMinimize="False" ShowMaximize="False" Title="Bloxstrap" />
<Grid Margin="16,0,16,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />

View File

@ -1,20 +1,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Bloxstrap.Enums;
using Bloxstrap.Helpers.Extensions;
using Bloxstrap.ViewModels;
using Wpf.Ui.Appearance;
using Wpf.Ui.Mvvm.Contracts;
using Wpf.Ui.Mvvm.Services;
@ -79,6 +70,7 @@ namespace Bloxstrap.Dialogs
_viewModel = new FluentDialogViewModel(this);
DataContext = _viewModel;
Title = App.ProjectName;
Icon = App.Settings.Prop.BootstrapperIcon.GetIcon().GetImageSource();
_themeService.SetTheme(App.Settings.Prop.Theme.GetFinal() == Enums.Theme.Dark ? ThemeType.Dark : ThemeType.Light);
_themeService.SetSystemAccent();

View File

@ -27,9 +27,9 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ui:TitleBar x:Name="RootTitleBar" Grid.Row="0" ForceShutdown="False" MinimizeToTray="False" ShowHelp="False" UseSnapLayout="True" Title="Bloxstrap Menu" Icon="pack://application:,,,/Bloxstrap.ico" />
<ui:TitleBar Background="{ui:ThemeResource ApplicationBackgroundBrush}" Padding="15,15,0,10" x:Name="RootTitleBar" Grid.Row="0" ForceShutdown="False" MinimizeToTray="False" ShowHelp="False" UseSnapLayout="True" Title="Bloxstrap Menu" Icon="pack://application:,,,/Bloxstrap.ico" />
<Grid x:Name="RootGrid" Grid.Row="1" Margin="13,0,0,0" Visibility="Visible">
<Grid x:Name="RootGrid" Grid.Row="1" Margin="13,5,0,0" Visibility="Visible">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />