Permalink
Browse files

Merge pull request #7171 from spycrab/qt_search_fix

Qt/GameList: Fix search messing up columns
  • Loading branch information...
spycrab committed Jun 27, 2018
2 parents beeb675 + 1ec0a39 commit 52dd41fa95649ede0ff0af2a3d173e541339986f
Showing with 20 additions and 11 deletions.
  1. +18 −11 Source/Core/DolphinQt2/GameList/GameList.cpp
  2. +2 −0 Source/Core/DolphinQt2/GameList/GameList.h
@@ -121,17 +121,7 @@ void GameList::MakeListView()
m_list->setColumnWidth(GameListModel::COL_SIZE, 85);
m_list->setColumnWidth(GameListModel::COL_ID, 70);
m_list->setColumnHidden(GameListModel::COL_PLATFORM, !SConfig::GetInstance().m_showSystemColumn);
m_list->setColumnHidden(GameListModel::COL_BANNER, !SConfig::GetInstance().m_showBannerColumn);
m_list->setColumnHidden(GameListModel::COL_TITLE, !SConfig::GetInstance().m_showTitleColumn);
m_list->setColumnHidden(GameListModel::COL_DESCRIPTION,
!SConfig::GetInstance().m_showDescriptionColumn);
m_list->setColumnHidden(GameListModel::COL_MAKER, !SConfig::GetInstance().m_showMakerColumn);
m_list->setColumnHidden(GameListModel::COL_ID, !SConfig::GetInstance().m_showIDColumn);
m_list->setColumnHidden(GameListModel::COL_COUNTRY, !SConfig::GetInstance().m_showRegionColumn);
m_list->setColumnHidden(GameListModel::COL_SIZE, !SConfig::GetInstance().m_showSizeColumn);
m_list->setColumnHidden(GameListModel::COL_FILE_NAME,
!SConfig::GetInstance().m_showFileNameColumn);
UpdateColumnVisibility();
m_list->verticalHeader()->hide();
m_list->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -147,6 +137,21 @@ GameList::~GameList()
m_list->horizontalHeader()->saveState());
}
void GameList::UpdateColumnVisibility()
{
m_list->setColumnHidden(GameListModel::COL_PLATFORM, !SConfig::GetInstance().m_showSystemColumn);
m_list->setColumnHidden(GameListModel::COL_BANNER, !SConfig::GetInstance().m_showBannerColumn);
m_list->setColumnHidden(GameListModel::COL_TITLE, !SConfig::GetInstance().m_showTitleColumn);
m_list->setColumnHidden(GameListModel::COL_DESCRIPTION,
!SConfig::GetInstance().m_showDescriptionColumn);
m_list->setColumnHidden(GameListModel::COL_MAKER, !SConfig::GetInstance().m_showMakerColumn);
m_list->setColumnHidden(GameListModel::COL_ID, !SConfig::GetInstance().m_showIDColumn);
m_list->setColumnHidden(GameListModel::COL_COUNTRY, !SConfig::GetInstance().m_showRegionColumn);
m_list->setColumnHidden(GameListModel::COL_SIZE, !SConfig::GetInstance().m_showSizeColumn);
m_list->setColumnHidden(GameListModel::COL_FILE_NAME,
!SConfig::GetInstance().m_showFileNameColumn);
}
void GameList::MakeEmptyView()
{
m_empty = new QLabel(this);
@@ -653,4 +658,6 @@ void GameList::SetSearchTerm(const QString& term)
m_list_proxy->invalidate();
m_grid_proxy->invalidate();
UpdateColumnVisibility();
}
@@ -55,6 +55,8 @@ class GameList final : public QStackedWidget
void ExportWiiSave();
void CompressISO();
void ChangeDisc();
void UpdateColumnVisibility();
void OnHeaderViewChanged();
void OnSectionResized(int index, int, int);

0 comments on commit 52dd41f

Please sign in to comment.