From bdfc7e86ac7584fb00b2f09bdab055eadd6bcd8a Mon Sep 17 00:00:00 2001 From: rmbgame Date: Sat, 5 Jun 2021 20:37:04 +0800 Subject: [PATCH] window style --- .../UI/Views/Controls/TitleBar.axaml.cs | 1 - .../Application/UI/Views/Windows/FluentWindow.cs | 15 +++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/TitleBar.axaml.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/TitleBar.axaml.cs index b4ab09e20..7c3c26ef9 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/TitleBar.axaml.cs +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Controls/TitleBar.axaml.cs @@ -13,7 +13,6 @@ namespace System.Application.UI.Views.Controls if (DI.Platform == System.Platform.Apple) { var title = this.FindControl("title"); - title.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Center; } } diff --git a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs index 686f0e14b..a650b2d85 100644 --- a/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs +++ b/src/ST.Client.Desktop.Avalonia/Application/UI/Views/Windows/FluentWindow.cs @@ -18,16 +18,19 @@ namespace Avalonia.Controls public FluentWindow(bool isSaveStatus = true) { - if (DI.Platform == System.Platform.Windows) - { - ExtendClientAreaToDecorationsHint = true; - ExtendClientAreaTitleBarHeightHint = -1; + //if (DI.Platform == System.Platform.Windows) + //{ + ExtendClientAreaToDecorationsHint = true; + //ExtendClientAreaTitleBarHeightHint = -1; - DI.Get().FixFluentWindowStyleOnWin7(PlatformImpl.Handle.Handle); - } + //} //SystemDecorations = SystemDecorations.BorderOnly; TransparencyLevelHint = WindowTransparencyLevel.AcrylicBlur; + if (DI.Platform == System.Platform.Windows) + { + DI.Get().FixFluentWindowStyleOnWin7(PlatformImpl.Handle.Handle); + } this.GetObservable(WindowStateProperty) .Subscribe(x =>