Merge pull request #7390 from Techjar/qt-save-grid-scale

Qt/GameList: Make grid view scale persistent
This commit is contained in:
Léo Lam 2018-09-16 15:21:00 +02:00 committed by GitHub
commit 3ecc4ed1c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,9 @@ GameList::GameList(QWidget* parent) : QStackedWidget(parent)
MakeGridView();
MakeEmptyView();
if (Settings::GetQSettings().contains(QStringLiteral("gridview/scale")))
m_model->SetScale(Settings::GetQSettings().value(QStringLiteral("gridview/scale")).toFloat());
connect(m_list, &QTableView::doubleClicked, this, &GameList::GameSelected);
connect(m_grid, &QListView::doubleClicked, this, &GameList::GameSelected);
connect(m_model, &QAbstractItemModel::rowsInserted, this, &GameList::ConsiderViewChange);
@ -155,6 +158,7 @@ GameList::~GameList()
{
Settings::GetQSettings().setValue(QStringLiteral("tableheader/state"),
m_list->horizontalHeader()->saveState());
Settings::GetQSettings().setValue(QStringLiteral("gridview/scale"), m_model->GetScale());
}
void GameList::UpdateColumnVisibility()