optimize<Sort>: remove sort repositories by name desc

This commit is contained in:
leo 2023-10-10 17:35:54 +08:00
parent ccb3c07064
commit 217a382849
4 changed files with 6 additions and 13 deletions

View file

@ -22,8 +22,7 @@ namespace SourceGit.Models {
/// 起始页仓库列表排序方式
/// </summary>
public enum SortMethod {
ByNameASC,
ByNameDESC,
ByName,
ByRecentlyOpened,
ByBookmark,
}
@ -73,7 +72,7 @@ namespace SourceGit.Models {
/// <summary>
/// 起始页仓库列表排序规则
/// </summary>
public SortMethod SortBy { get; set; } = SortMethod.ByNameASC;
public SortMethod SortBy { get; set; } = SortMethod.ByName;
}
/// <summary>

View file

@ -504,8 +504,7 @@
<sys:String x:Key="Text.Month.11">Nov</sys:String>
<sys:String x:Key="Text.Month.12">Dec</sys:String>
<sys:String x:Key="Text.Sort.NameAsc">By Name</sys:String>
<sys:String x:Key="Text.Sort.NameDesc">By Name Inversed</sys:String>
<sys:String x:Key="Text.Sort.Name">By Name</sys:String>
<sys:String x:Key="Text.Sort.RecentlyOpened">By Recently Opened</sys:String>
<sys:String x:Key="Text.Sort.Bookmark">By Bookmark Color</sys:String>

View file

@ -503,8 +503,7 @@
<sys:String x:Key="Text.Month.11">11月</sys:String>
<sys:String x:Key="Text.Month.12">12月</sys:String>
<sys:String x:Key="Text.Sort.NameAsc">按名称正序</sys:String>
<sys:String x:Key="Text.Sort.NameDesc">按名称倒序</sys:String>
<sys:String x:Key="Text.Sort.Name">按名称升序</sys:String>
<sys:String x:Key="Text.Sort.RecentlyOpened">按最近访问</sys:String>
<sys:String x:Key="Text.Sort.Bookmark">按书签颜色</sys:String>

View file

@ -81,8 +81,7 @@ namespace SourceGit.Views.Widgets {
menu.StaysOpen = false;
menu.Focusable = true;
FillSortMenu(menu, Models.Preference.SortMethod.ByNameASC, "Sort.NameAsc");
FillSortMenu(menu, Models.Preference.SortMethod.ByNameDESC, "Sort.NameDesc");
FillSortMenu(menu, Models.Preference.SortMethod.ByName, "Sort.Name");
FillSortMenu(menu, Models.Preference.SortMethod.ByRecentlyOpened, "Sort.RecentlyOpened");
FillSortMenu(menu, Models.Preference.SortMethod.ByBookmark, "Sort.Bookmark");
@ -229,12 +228,9 @@ namespace SourceGit.Views.Widgets {
}
switch (Models.Preference.Instance.General.SortBy) {
case Models.Preference.SortMethod.ByNameASC:
case Models.Preference.SortMethod.ByName:
visibles.Sort((l, r) => l.Name.CompareTo(r.Name));
break;
case Models.Preference.SortMethod.ByNameDESC:
visibles.Sort((l, r) => r.Name.CompareTo(l.Name));
break;
case Models.Preference.SortMethod.ByRecentlyOpened:
visibles.Sort((l, r) => r.LastOpenTime.CompareTo(l.LastOpenTime));
break;