From 7b70951c937b28752c506f77389419ad9c69f355 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 1 Mar 2024 14:09:39 +0800 Subject: [PATCH] style: supports two size rules for tabs in titlebar - fixed width or size to content --- src/Resources/Locales/en_US.axaml | 1 + src/Resources/Locales/zh_CN.axaml | 1 + src/ViewModels/Preference.cs | 6 ++++++ src/Views/Launcher.axaml | 16 +++++++--------- src/Views/Launcher.axaml.cs | 19 +++++++++++++++++++ src/Views/Preference.axaml | 7 ++++++- 6 files changed, 40 insertions(+), 10 deletions(-) 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 @@ - - + -