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

@ -6,6 +6,7 @@ using System.Runtime.Versioning;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Platform;
namespace SourceGit.Native
{
@ -19,7 +20,17 @@ namespace SourceGit.Native
public void SetupWindow(Window window)
{
// Do Nothing.
if (OS.UseSystemWindowFrame)
{
window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.Default;
window.ExtendClientAreaToDecorationsHint = false;
}
else
{
window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome;
window.ExtendClientAreaToDecorationsHint = true;
window.Classes.Add("custom_window_frame");
}
}
public string FindGitExecutable()