From 63a6ef256e77732b568e5c243a268752ea96a573 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 23 Aug 2023 11:39:47 +0800 Subject: [PATCH] feature: supports for customizing max number of displayed history commits --- src/Models/Preference.cs | 8 +++++- src/Resources/Locales/en_US.xaml | 7 ++--- src/Resources/Locales/zh_CN.xaml | 5 +--- src/Views/Preference.xaml | 40 ++++++++++++++++++++++++----- src/Views/Widgets/Histories.xaml.cs | 2 +- 5 files changed, 45 insertions(+), 17 deletions(-) diff --git a/src/Models/Preference.cs b/src/Models/Preference.cs index ddb1fab1..dfc76c62 100644 --- a/src/Models/Preference.cs +++ b/src/Models/Preference.cs @@ -54,7 +54,8 @@ namespace SourceGit.Models { /// public string FontFamilyContentSetting { get; set; } = "Consolas"; - [JsonIgnore] public string FontFamilyContent { + [JsonIgnore] + public string FontFamilyContent { get => FontFamilyContentSetting + ",Microsoft YaHei UI"; set => FontFamilyContentSetting = value; } @@ -64,6 +65,11 @@ namespace SourceGit.Models { /// public bool UseDarkTheme { get; set; } = false; + /// + /// 历史提交记录最多显示的条目数 + /// + public uint MaxHistoryCommits { get; set; } = 20000; + /// /// 起始页仓库列表排序规则 /// diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 30ea054c..02edad22 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -355,15 +355,12 @@ Preference GENERAL - Language + Display Language Window Font Content Font - Avatar Server - Check for update Use dark theme Restore windows - Enable crash report (maybe include related path) - Use Windows Terminal instead of cmd.exe + Max History Commits GIT Install Path Input path for git.exe diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index e7a48dfc..766c80eb 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -357,12 +357,9 @@ 显示语言 系统字体 文本字体 - 头像服务 - 启用检测更新 启用暗色主题 启动时恢复上次打开的仓库 - 开启崩溃上报(可能涉及上报相关路径) - 使用 Windows Terminal 打开 Git 终端 + 最大历史提交数 GIT配置 安装路径 填写git.exe所在位置 diff --git a/src/Views/Preference.xaml b/src/Views/Preference.xaml index ec9b371a..26fd6b03 100644 --- a/src/Views/Preference.xaml +++ b/src/Views/Preference.xaml @@ -68,7 +68,7 @@ - + @@ -130,17 +130,45 @@ + + + + + + + + + + + + + + + @@ -160,7 +188,7 @@ - + @@ -297,7 +325,7 @@ - + @@ -358,7 +386,7 @@ - + diff --git a/src/Views/Widgets/Histories.xaml.cs b/src/Views/Widgets/Histories.xaml.cs index 58e05639..46bc1095 100644 --- a/src/Views/Widgets/Histories.xaml.cs +++ b/src/Views/Widgets/Histories.xaml.cs @@ -51,7 +51,7 @@ namespace SourceGit.Views.Widgets { }); Task.Run(() => { - var limits = "-20000 "; + var limits = $"-{Models.Preference.Instance.General.MaxHistoryCommits} "; repo.UpdateFilters(); if (repo.Filters.Count > 0) {