diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml
index ca0bda14..775dff26 100644
--- a/src/Resources/Locales/de_DE.axaml
+++ b/src/Resources/Locales/de_DE.axaml
@@ -382,13 +382,13 @@
Verwende nur die Monospace-Schriftart im Texteditor
Design
Design-Anpassungen
+ Fixe Tab-Breite in Titelleiste
ALLGEMEIN
Beim Starten nach Updates suchen
Sprache
Commit-Historie
Zuletzt geöffnete Tabs beim Starten wiederherstellen
Längenvorgabe für Commit-Nachrichten
- Fixe Tab-Breite in Titelleiste
Sichtbare Vergleichskontextzeilen
GIT
Remotes automatisch fetchen
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index 2fe1ef9d..29e5d802 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -379,13 +379,14 @@
Only use monospace font in text editor
Theme
Theme Overrides
+ Use fixed tab width in titlebar
+ Use native window frame
GENERAL
Check for updates on startup
Language
History Commits
Restore last opened tab(s) on startup
Subject Guide Length
- Use fixed tab width in titlebar
Visible Diff Context Lines
GIT
Fetch remotes automatically
diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml
index f488b651..e725dc5a 100644
--- a/src/Resources/Locales/pt_BR.axaml
+++ b/src/Resources/Locales/pt_BR.axaml
@@ -382,13 +382,13 @@
Usar apenas fonte monoespaçada no editor de texto
Tema
Sobrescrever Tema
+ Usar largura fixa da aba na barra de título
GERAL
Verificar atualizações na inicialização
Idioma
Commits do Histórico
Restaurar as últimas abas abertas na inicialização
Comprimento do Guia de Assunto
- Usar largura fixa da aba na barra de título
Linhas de Contexto de Diferença Visíveis
GIT
Buscar remotos automaticamente
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index 6c61b41f..4bb0eae1 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -382,13 +382,14 @@
仅在文本编辑器中使用等宽字体
主题
主题自定义
+ 主标签使用固定宽度
+ 使用系统默认窗体样式
通用配置
启动时检测软件更新
显示语言
最大历史提交数
启动时恢复上次打开的仓库
SUBJECT字数检测
- 使用固定宽度的标题栏标签
DIFF上下文行数
GIT配置
启用定时自动拉取远程更新
diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml
index 84f7bd25..6a628fc7 100644
--- a/src/Resources/Locales/zh_TW.axaml
+++ b/src/Resources/Locales/zh_TW.axaml
@@ -382,13 +382,14 @@
僅在文字編輯器中使用等寬字體
主題
主題自訂
+ 使用固定寬度的標題欄標籤
+ 使用系統預設窗口樣式
通用配置
啟動時檢測軟體更新
顯示語言
最大歷史提交數
啟動時恢復上次開啟的倉庫
SUBJECT字數檢測
- 使用固定寬度的標題欄標籤
DIFF上下文行數
GIT配置
啟用定時自動拉取遠端更新
diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs
index a3f18fd5..858cc2d8 100644
--- a/src/ViewModels/Preference.cs
+++ b/src/ViewModels/Preference.cs
@@ -105,6 +105,12 @@ namespace SourceGit.ViewModels
}
}
+ public bool UseSystemWindowFrame
+ {
+ get => _useSystemWindowFrame;
+ set => SetProperty(ref _useSystemWindowFrame, value);
+ }
+
public double DefaultFontSize
{
get => _defaultFontSize;
@@ -492,6 +498,7 @@ namespace SourceGit.ViewModels
private string _defaultFontFamily = string.Empty;
private string _monospaceFontFamily = string.Empty;
private bool _onlyUseMonoFontInEditor = false;
+ private bool _useSystemWindowFrame = false;
private double _defaultFontSize = 13;
private LayoutInfo _layout = new LayoutInfo();
diff --git a/src/Views/About.axaml b/src/Views/About.axaml
index baf62e5a..4ff12c80 100644
--- a/src/Views/About.axaml
+++ b/src/Views/About.axaml
@@ -13,7 +13,7 @@
WindowStartupLocation="CenterScreen">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
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)
diff --git a/src/Views/ConfirmRestart.axaml b/src/Views/ConfirmRestart.axaml
new file mode 100644
index 00000000..4e0ac386
--- /dev/null
+++ b/src/Views/ConfirmRestart.axaml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Views/ConfirmRestart.axaml.cs b/src/Views/ConfirmRestart.axaml.cs
new file mode 100644
index 00000000..d0647731
--- /dev/null
+++ b/src/Views/ConfirmRestart.axaml.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Diagnostics;
+
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Interactivity;
+
+namespace SourceGit.Views
+{
+ public partial class ConfirmRestart : ChromelessWindow
+ {
+ public ConfirmRestart()
+ {
+ InitializeComponent();
+ }
+
+ private void BeginMoveWindow(object _, PointerPressedEventArgs e)
+ {
+ BeginMoveDrag(e);
+ }
+
+ private void CloseWindow(object _1, RoutedEventArgs _2)
+ {
+ Console.Out.WriteLine("No passphrase entered.");
+ App.Quit(-1);
+ }
+
+ private void Restart(object _1, RoutedEventArgs _2)
+ {
+ var selfExecFile = Process.GetCurrentProcess().MainModule!.FileName;
+ Process.Start(selfExecFile);
+ App.Quit(-1);
+ }
+ }
+}
diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml
index ace50cc6..79e716c4 100644
--- a/src/Views/FileHistories.axaml
+++ b/src/Views/FileHistories.axaml
@@ -9,18 +9,18 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SourceGit.Views.FileHistories"
x:DataType="vm:FileHistories"
- x:Name="me"
+ x:Name="ThisControl"
Icon="/App.ico"
Title="{DynamicResource Text.FileHistory}"
MinWidth="1280" MinHeight="720">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -72,7 +73,7 @@
-
+
diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs
index d2672c5e..aa184cf2 100644
--- a/src/Views/Launcher.axaml.cs
+++ b/src/Views/Launcher.axaml.cs
@@ -8,6 +8,25 @@ namespace SourceGit.Views
{
public partial class Launcher : ChromelessWindow
{
+ public static readonly StyledProperty CaptionHeightProperty =
+ AvaloniaProperty.Register(nameof(CaptionHeight));
+
+ public GridLength CaptionHeight
+ {
+ get => GetValue(CaptionHeightProperty);
+ set => SetValue(CaptionHeightProperty, value);
+ }
+
+ public bool IsRightCaptionButtonsVisible
+ {
+ get
+ {
+ if (OperatingSystem.IsLinux())
+ return !ViewModels.Preference.Instance.UseSystemWindowFrame;
+ return OperatingSystem.IsWindows();
+ }
+ }
+
public Launcher()
{
var layout = ViewModels.Preference.Instance.Layout;
@@ -17,6 +36,11 @@ namespace SourceGit.Views
Height = layout.LauncherHeight;
}
+ if (UseSystemWindowFrame)
+ CaptionHeight = new GridLength(30);
+ else
+ CaptionHeight = new GridLength(38);
+
InitializeComponent();
}
@@ -38,13 +62,15 @@ namespace SourceGit.Views
{
base.OnPropertyChanged(change);
- if (change.Property == WindowStateProperty && MainLayout != null)
+ if (change.Property == WindowStateProperty)
{
var state = (WindowState)change.NewValue!;
- if (state == WindowState.Maximized)
- MainLayout.RowDefinitions[0].Height = new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
+ if (OperatingSystem.IsLinux() && UseSystemWindowFrame)
+ CaptionHeight = new GridLength(30);
+ else if (state == WindowState.Maximized)
+ CaptionHeight = new GridLength(OperatingSystem.IsMacOS() ? 34 : 30);
else
- MainLayout.RowDefinitions[0].Height = new GridLength(38);
+ CaptionHeight = new GridLength(38);
ViewModels.Preference.Instance.Layout.LauncherWindowState = state;
}
diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml
index 2d0cf6ea..7576ab4e 100644
--- a/src/Views/Preference.axaml
+++ b/src/Views/Preference.axaml
@@ -18,7 +18,7 @@
WindowStartupLocation="CenterScreen">
-
+
-
+
-
-
@@ -135,7 +130,7 @@
-
+
+
+
+
+
diff --git a/src/Views/Preference.axaml.cs b/src/Views/Preference.axaml.cs
index 1e2f6902..1c5d203a 100644
--- a/src/Views/Preference.axaml.cs
+++ b/src/Views/Preference.axaml.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using Avalonia;
+using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Platform.Storage;
@@ -247,5 +248,19 @@ namespace SourceGit.Views
if (changed)
new Commands.Config(null).Set(key, value);
}
+
+ private void OnUseNativeWindowFrameChanged(object sender, RoutedEventArgs e)
+ {
+ if (sender is CheckBox box)
+ {
+ ViewModels.Preference.Instance.UseSystemWindowFrame = box.IsChecked == true;
+ ViewModels.Preference.Instance.Save();
+
+ var dialog = new ConfirmRestart();
+ App.OpenDialog(dialog);
+ }
+
+ e.Handled = true;
+ }
}
}
diff --git a/src/Views/RepositoryConfigure.axaml b/src/Views/RepositoryConfigure.axaml
index 5ecaee22..f5d16fd4 100644
--- a/src/Views/RepositoryConfigure.axaml
+++ b/src/Views/RepositoryConfigure.axaml
@@ -8,14 +8,15 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SourceGit.Views.RepositoryConfigure"
x:DataType="vm:RepositoryConfigure"
+ x:Name="ThisControl"
Icon="/App.ico"
Title="{DynamicResource Text.Configure}"
Width="600" SizeToContent="Height"
CanResize="False"
WindowStartupLocation="CenterOwner">
-
+
-
+
-
+
-
+
-
+