Fix arbitrary sorting by "Favorite" in the UI by making it the same as sorting alphabetically while giving favorites priority.
This commit is contained in:
parent
7969fb6bba
commit
ffee98889e
1 changed files with 4 additions and 2 deletions
|
@ -965,8 +965,10 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||
: SortExpressionComparer<ApplicationData>.Descending(app => app.FileSize),
|
||||
ApplicationSort.Path => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.Path)
|
||||
: SortExpressionComparer<ApplicationData>.Descending(app => app.Path),
|
||||
ApplicationSort.Favorite => !IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.Favorite)
|
||||
: SortExpressionComparer<ApplicationData>.Descending(app => app.Favorite),
|
||||
// Favorite behaves same as sort by name except give favorited apps special ordering by prepending a space
|
||||
// The intent is to return a block of favorited apps in alphabetical order, followed by all other apps in alphabetical order.
|
||||
ApplicationSort.Favorite => IsAscending ? SortExpressionComparer<ApplicationData>.Ascending(app => app.Favorite ? ' ' + app.Name : app.Name)
|
||||
: SortExpressionComparer<ApplicationData>.Descending(app => app.Favorite ? ' ' + app.Name : app.Name),
|
||||
_ => null,
|
||||
#pragma warning restore IDE0055
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue