mirror of
https://github.com/oMaN-Rod/nxDumpFuse.git
synced 2024-12-26 10:26:01 +00:00
45 lines
No EOL
1.4 KiB
C#
45 lines
No EOL
1.4 KiB
C#
using System;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Controls.Primitives;
|
|
using Avalonia.Platform;
|
|
using Avalonia.Styling;
|
|
|
|
namespace nxDumpFuse
|
|
{
|
|
public class FluentWindow : Window, IStyleable
|
|
{
|
|
Type IStyleable.StyleKey => typeof(Window);
|
|
|
|
public FluentWindow()
|
|
{
|
|
ExtendClientAreaToDecorationsHint = true;
|
|
ExtendClientAreaTitleBarHeightHint = -1;
|
|
|
|
TransparencyLevelHint = WindowTransparencyLevel.AcrylicBlur;
|
|
|
|
this.GetObservable(WindowStateProperty)
|
|
.Subscribe(x =>
|
|
{
|
|
PseudoClasses.Set(":maximized", x == WindowState.Maximized);
|
|
PseudoClasses.Set(":fullscreen", x == WindowState.FullScreen);
|
|
});
|
|
|
|
this.GetObservable(IsExtendedIntoWindowDecorationsProperty)
|
|
.Subscribe(x =>
|
|
{
|
|
if (x) return;
|
|
SystemDecorations = SystemDecorations.Full;
|
|
TransparencyLevelHint = WindowTransparencyLevel.Blur;
|
|
});
|
|
}
|
|
|
|
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
|
|
{
|
|
base.OnApplyTemplate(e);
|
|
ExtendClientAreaChromeHints =
|
|
ExtendClientAreaChromeHints.PreferSystemChrome |
|
|
ExtendClientAreaChromeHints.OSXThickTitleBar;
|
|
}
|
|
}
|
|
} |