Remember GUI column sort and separate hotkey settings from emulated input settings (#1223)
* Separate hotkey settings from emulated input settings * Remember gui column sort * nit * fix schema * nit * Remove unused SaveDataPath to speed up game list loading * Reset the vertical scrollbar to the top when titles finish loading
This commit is contained in:
parent
9a49f8aec9
commit
68a6960617
12 changed files with 805 additions and 518 deletions
|
@ -167,7 +167,11 @@ namespace Ryujinx.Ui
|
|||
_tableStore.SetSortFunc(5, TimePlayedSort);
|
||||
_tableStore.SetSortFunc(6, LastPlayedSort);
|
||||
_tableStore.SetSortFunc(8, FileSizeSort);
|
||||
_tableStore.SetSortColumnId(0, SortType.Descending);
|
||||
|
||||
int columnId = ConfigurationState.Instance.Ui.ColumnSort.SortColumnId;
|
||||
bool ascending = ConfigurationState.Instance.Ui.ColumnSort.SortAscending;
|
||||
|
||||
_tableStore.SetSortColumnId(columnId, ascending ? SortType.Ascending : SortType.Descending);
|
||||
|
||||
_gameTable.EnableSearch = true;
|
||||
_gameTable.SearchColumn = 2;
|
||||
|
@ -254,15 +258,45 @@ namespace Ryujinx.Ui
|
|||
|
||||
foreach (TreeViewColumn column in _gameTable.Columns)
|
||||
{
|
||||
if (column.Title == "Fav" && ConfigurationState.Instance.Ui.GuiColumns.FavColumn) column.SortColumnId = 0;
|
||||
else if (column.Title == "Application" && ConfigurationState.Instance.Ui.GuiColumns.AppColumn) column.SortColumnId = 2;
|
||||
else if (column.Title == "Developer" && ConfigurationState.Instance.Ui.GuiColumns.DevColumn) column.SortColumnId = 3;
|
||||
else if (column.Title == "Version" && ConfigurationState.Instance.Ui.GuiColumns.VersionColumn) column.SortColumnId = 4;
|
||||
else if (column.Title == "Time Played" && ConfigurationState.Instance.Ui.GuiColumns.TimePlayedColumn) column.SortColumnId = 5;
|
||||
else if (column.Title == "Last Played" && ConfigurationState.Instance.Ui.GuiColumns.LastPlayedColumn) column.SortColumnId = 6;
|
||||
else if (column.Title == "File Ext" && ConfigurationState.Instance.Ui.GuiColumns.FileExtColumn) column.SortColumnId = 7;
|
||||
else if (column.Title == "File Size" && ConfigurationState.Instance.Ui.GuiColumns.FileSizeColumn) column.SortColumnId = 8;
|
||||
else if (column.Title == "Path" && ConfigurationState.Instance.Ui.GuiColumns.PathColumn) column.SortColumnId = 9;
|
||||
switch (column.Title)
|
||||
{
|
||||
case "Fav":
|
||||
column.SortColumnId = 0;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Application":
|
||||
column.SortColumnId = 2;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Developer":
|
||||
column.SortColumnId = 3;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Version":
|
||||
column.SortColumnId = 4;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Time Played":
|
||||
column.SortColumnId = 5;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Last Played":
|
||||
column.SortColumnId = 6;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "File Ext":
|
||||
column.SortColumnId = 7;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "File Size":
|
||||
column.SortColumnId = 8;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
case "Path":
|
||||
column.SortColumnId = 9;
|
||||
column.Clicked += Column_Clicked;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -666,6 +700,11 @@ namespace Ryujinx.Ui
|
|||
}
|
||||
|
||||
_progressBar.Value = barValue;
|
||||
|
||||
if (args.NumAppsLoaded == args.NumAppsFound) // Reset the vertical scrollbar to the top when titles finish loading
|
||||
{
|
||||
_gameTableWindow.Vadjustment.Value = 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -707,6 +746,16 @@ namespace Ryujinx.Ui
|
|||
});
|
||||
}
|
||||
|
||||
private void Column_Clicked(object sender, EventArgs args)
|
||||
{
|
||||
TreeViewColumn column = (TreeViewColumn)sender;
|
||||
|
||||
ConfigurationState.Instance.Ui.ColumnSort.SortColumnId.Value = column.SortColumnId;
|
||||
ConfigurationState.Instance.Ui.ColumnSort.SortAscending.Value = column.SortOrder == SortType.Ascending;
|
||||
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
private void Row_Activated(object sender, RowActivatedArgs args)
|
||||
{
|
||||
_gameTableSelection.GetSelected(out TreeIter treeIter);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue