diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index 4e2ea7a7..9d068e94 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -381,6 +381,7 @@
Theme
History Commits
Restore windows
+ Use fixed tab width in titlebar
Use macOS style titlebar
GIT
Install Path
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index 5850a2fc..3deb6206 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -380,6 +380,7 @@
主题
最大历史提交数
启动时恢复上次打开的仓库
+ 使用固定宽度的标题栏标签
使用macOS风格的标题栏
GIT配置
安装路径
diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs
index c453e63c..d711622e 100644
--- a/src/ViewModels/Preference.cs
+++ b/src/ViewModels/Preference.cs
@@ -71,6 +71,11 @@ namespace SourceGit.ViewModels {
set => SetProperty(ref _restoreTabs, value);
}
+ public bool UseFixedTabWidth {
+ get => _useFixedTabWidth;
+ set => SetProperty(ref _useFixedTabWidth, value);
+ }
+
public bool UseMacOSStyle {
get => _useMacOSStyle;
set => SetProperty(ref _useMacOSStyle, value);
@@ -274,6 +279,7 @@ namespace SourceGit.ViewModels {
private string _theme = "Default";
private int _maxHistoryCommits = 20000;
private bool _restoreTabs = false;
+ private bool _useFixedTabWidth = true;
private bool _useMacOSStyle = OperatingSystem.IsMacOS();
private bool _useTwoColumnsLayoutInHistories = false;
private bool _useCombinedTextDiff = true;
diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml
index 5645c443..c98ad8fb 100644
--- a/src/Views/Launcher.axaml
+++ b/src/Views/Launcher.axaml
@@ -138,19 +138,17 @@
-
-
+
-
+
diff --git a/src/Views/Launcher.axaml.cs b/src/Views/Launcher.axaml.cs
index 6d17e383..4ba8fe43 100644
--- a/src/Views/Launcher.axaml.cs
+++ b/src/Views/Launcher.axaml.cs
@@ -2,8 +2,27 @@ using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
+using System;
namespace SourceGit.Views {
+ public class LauncherTab : Grid {
+ public static readonly StyledProperty UseFixedTabWidthProperty =
+ AvaloniaProperty.Register(nameof(UseFixedTabWidth), false);
+
+ public bool UseFixedTabWidth {
+ get => GetValue(UseFixedTabWidthProperty);
+ set => SetValue(UseFixedTabWidthProperty, value);
+ }
+
+ protected override Type StyleKeyOverride => typeof(Grid);
+
+ static LauncherTab() {
+ UseFixedTabWidthProperty.Changed.AddClassHandler((tab, ev) => {
+ tab.Width = tab.UseFixedTabWidth ? 200.0 : double.NaN;
+ });
+ }
+ }
+
public partial class Launcher : Window, Models.INotificationReceiver {
public Launcher() {
DataContext = new ViewModels.Launcher();
diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml
index 081c748f..d2e2431e 100644
--- a/src/Views/Preference.axaml
+++ b/src/Views/Preference.axaml
@@ -57,7 +57,7 @@
-
+
+
+