feature: supports using native window frame on Linux (#390)

This commit is contained in:
leo 2024-08-22 12:37:26 +08:00
parent eaf5eba0e7
commit d5e51d1f32
No known key found for this signature in database
26 changed files with 218 additions and 39 deletions

View file

@ -8,14 +8,24 @@ namespace SourceGit.Views
{
public class ChromelessWindow : Window
{
public bool UseSystemWindowFrame
{
get => OperatingSystem.IsLinux() && ViewModels.Preference.Instance.UseSystemWindowFrame;
}
protected override Type StyleKeyOverride => typeof(Window);
public ChromelessWindow()
{
if (OperatingSystem.IsLinux())
Classes.Add("custom_window_frame");
{
if (!UseSystemWindowFrame)
Classes.Add("custom_window_frame");
}
else if (OperatingSystem.IsWindows())
{
Classes.Add("fix_maximized_padding");
}
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)