diff --git a/src/Models/Preference.cs b/src/Models/Preference.cs index dfc76c62..353a26f8 100644 --- a/src/Models/Preference.cs +++ b/src/Models/Preference.cs @@ -22,8 +22,7 @@ namespace SourceGit.Models { /// 起始页仓库列表排序方式 /// public enum SortMethod { - ByNameASC, - ByNameDESC, + ByName, ByRecentlyOpened, ByBookmark, } @@ -73,7 +72,7 @@ namespace SourceGit.Models { /// /// 起始页仓库列表排序规则 /// - public SortMethod SortBy { get; set; } = SortMethod.ByNameASC; + public SortMethod SortBy { get; set; } = SortMethod.ByName; } /// diff --git a/src/Resources/Locales/en_US.xaml b/src/Resources/Locales/en_US.xaml index 933f61d2..648a03fb 100644 --- a/src/Resources/Locales/en_US.xaml +++ b/src/Resources/Locales/en_US.xaml @@ -504,8 +504,7 @@ Nov Dec - By Name - By Name Inversed + By Name By Recently Opened By Bookmark Color diff --git a/src/Resources/Locales/zh_CN.xaml b/src/Resources/Locales/zh_CN.xaml index fb46362b..e2eedd24 100644 --- a/src/Resources/Locales/zh_CN.xaml +++ b/src/Resources/Locales/zh_CN.xaml @@ -503,8 +503,7 @@ 11月 12月 - 按名称正序 - 按名称倒序 + 按名称升序 按最近访问 按书签颜色 diff --git a/src/Views/Widgets/Welcome.xaml.cs b/src/Views/Widgets/Welcome.xaml.cs index c65d5c23..fcc3de42 100644 --- a/src/Views/Widgets/Welcome.xaml.cs +++ b/src/Views/Widgets/Welcome.xaml.cs @@ -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;