mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
optimize<Sort>: remove sort repositories by name desc
This commit is contained in:
parent
ccb3c07064
commit
217a382849
4 changed files with 6 additions and 13 deletions
|
@ -22,8 +22,7 @@ namespace SourceGit.Models {
|
||||||
/// 起始页仓库列表排序方式
|
/// 起始页仓库列表排序方式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum SortMethod {
|
public enum SortMethod {
|
||||||
ByNameASC,
|
ByName,
|
||||||
ByNameDESC,
|
|
||||||
ByRecentlyOpened,
|
ByRecentlyOpened,
|
||||||
ByBookmark,
|
ByBookmark,
|
||||||
}
|
}
|
||||||
|
@ -73,7 +72,7 @@ namespace SourceGit.Models {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 起始页仓库列表排序规则
|
/// 起始页仓库列表排序规则
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SortMethod SortBy { get; set; } = SortMethod.ByNameASC;
|
public SortMethod SortBy { get; set; } = SortMethod.ByName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -504,8 +504,7 @@
|
||||||
<sys:String x:Key="Text.Month.11">Nov</sys:String>
|
<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.Month.12">Dec</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.Sort.NameAsc">By Name</sys:String>
|
<sys:String x:Key="Text.Sort.Name">By Name</sys:String>
|
||||||
<sys:String x:Key="Text.Sort.NameDesc">By Name Inversed</sys:String>
|
|
||||||
<sys:String x:Key="Text.Sort.RecentlyOpened">By Recently Opened</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>
|
<sys:String x:Key="Text.Sort.Bookmark">By Bookmark Color</sys:String>
|
||||||
|
|
||||||
|
|
|
@ -503,8 +503,7 @@
|
||||||
<sys:String x:Key="Text.Month.11">11月</sys:String>
|
<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.Month.12">12月</sys:String>
|
||||||
|
|
||||||
<sys:String x:Key="Text.Sort.NameAsc">按名称正序</sys:String>
|
<sys:String x:Key="Text.Sort.Name">按名称升序</sys:String>
|
||||||
<sys:String x:Key="Text.Sort.NameDesc">按名称倒序</sys:String>
|
|
||||||
<sys:String x:Key="Text.Sort.RecentlyOpened">按最近访问</sys:String>
|
<sys:String x:Key="Text.Sort.RecentlyOpened">按最近访问</sys:String>
|
||||||
<sys:String x:Key="Text.Sort.Bookmark">按书签颜色</sys:String>
|
<sys:String x:Key="Text.Sort.Bookmark">按书签颜色</sys:String>
|
||||||
|
|
||||||
|
|
|
@ -81,8 +81,7 @@ namespace SourceGit.Views.Widgets {
|
||||||
menu.StaysOpen = false;
|
menu.StaysOpen = false;
|
||||||
menu.Focusable = true;
|
menu.Focusable = true;
|
||||||
|
|
||||||
FillSortMenu(menu, Models.Preference.SortMethod.ByNameASC, "Sort.NameAsc");
|
FillSortMenu(menu, Models.Preference.SortMethod.ByName, "Sort.Name");
|
||||||
FillSortMenu(menu, Models.Preference.SortMethod.ByNameDESC, "Sort.NameDesc");
|
|
||||||
FillSortMenu(menu, Models.Preference.SortMethod.ByRecentlyOpened, "Sort.RecentlyOpened");
|
FillSortMenu(menu, Models.Preference.SortMethod.ByRecentlyOpened, "Sort.RecentlyOpened");
|
||||||
FillSortMenu(menu, Models.Preference.SortMethod.ByBookmark, "Sort.Bookmark");
|
FillSortMenu(menu, Models.Preference.SortMethod.ByBookmark, "Sort.Bookmark");
|
||||||
|
|
||||||
|
@ -229,12 +228,9 @@ namespace SourceGit.Views.Widgets {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (Models.Preference.Instance.General.SortBy) {
|
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));
|
visibles.Sort((l, r) => l.Name.CompareTo(r.Name));
|
||||||
break;
|
break;
|
||||||
case Models.Preference.SortMethod.ByNameDESC:
|
|
||||||
visibles.Sort((l, r) => r.Name.CompareTo(l.Name));
|
|
||||||
break;
|
|
||||||
case Models.Preference.SortMethod.ByRecentlyOpened:
|
case Models.Preference.SortMethod.ByRecentlyOpened:
|
||||||
visibles.Sort((l, r) => r.LastOpenTime.CompareTo(l.LastOpenTime));
|
visibles.Sort((l, r) => r.LastOpenTime.CompareTo(l.LastOpenTime));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue