refactor: replace all window with custom ChromelessWindow

This commit is contained in:
leo 2024-06-13 11:54:10 +08:00
parent 68061f82b1
commit f5b35d3db2
No known key found for this signature in database
GPG key ID: B528468E49CD0E58
23 changed files with 414 additions and 649 deletions

View file

@ -1,34 +0,0 @@
using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Data.Converters;
namespace SourceGit.Converters
{
public static class WindowStateConverters
{
public static readonly FuncValueConverter<WindowState, Thickness> ToContentMargin =
new FuncValueConverter<WindowState, Thickness>(state =>
{
if (OperatingSystem.IsWindows() && state == WindowState.Maximized)
return new Thickness(6);
else if (OperatingSystem.IsLinux() && state != WindowState.Maximized)
return new Thickness(6);
else
return new Thickness(0);
});
public static readonly FuncValueConverter<WindowState, GridLength> ToTitleBarHeight =
new FuncValueConverter<WindowState, GridLength>(state =>
{
if (state == WindowState.Maximized)
return new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
else
return new GridLength(38);
});
public static readonly FuncValueConverter<WindowState, bool> IsNormal =
new FuncValueConverter<WindowState, bool>(state => state == WindowState.Normal);
}
}