code_style: move platform dependent code to initialize window to namespace SourceGit.Native

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-05-12 21:52:50 +08:00
parent c62b4a031f
commit ef4b639f8e
No known key found for this signature in database
9 changed files with 41 additions and 68 deletions

View file

@ -29,14 +29,9 @@ namespace SourceGit.Views
set => SetValue(HasLeftCaptionButtonProperty, value);
}
public bool IsRightCaptionButtonsVisible
public bool HasRightCaptionButton
{
get
{
if (OperatingSystem.IsLinux())
return !ViewModels.Preferences.Instance.UseSystemWindowFrame;
return OperatingSystem.IsWindows();
}
get => OperatingSystem.IsWindows() || !Native.OS.UseSystemWindowFrame;
}
public Launcher()
@ -52,8 +47,7 @@ namespace SourceGit.Views
{
HasLeftCaptionButton = true;
CaptionHeight = new GridLength(34);
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome |
ExtendClientAreaChromeHints.OSXThickTitleBar;
ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome | ExtendClientAreaChromeHints.OSXThickTitleBar;
}
else if (UseSystemWindowFrame)
{