summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Nico Bosshard2017-05-06 12:08:28 +0200
committerGravatar Nico Bosshard2017-05-06 12:08:28 +0200
commitdb256ea395e3b160bd161ddb5205870c29697150 (patch)
tree7c143281fe31e3f7d3ae79101debe073e1f1e20c
parentFixed some more typos (diff)
downloadyuzu-db256ea395e3b160bd161ddb5205870c29697150.tar.gz
yuzu-db256ea395e3b160bd161ddb5205870c29697150.tar.xz
yuzu-db256ea395e3b160bd161ddb5205870c29697150.zip
Don’t focus the search field if the game is empty
-rw-r--r--src/citra_qt/game_list.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp
index 582aa0857..51257520b 100644
--- a/src/citra_qt/game_list.cpp
+++ b/src/citra_qt/game_list.cpp
@@ -236,7 +236,9 @@ GameList::~GameList() {
236} 236}
237 237
238void GameList::setFilterFocus() { 238void GameList::setFilterFocus() {
239 search_field->setFocus(); 239 if (tree_view->model()->rowCount() > 0) {
240 search_field->setFocus();
241 }
240} 242}
241 243
242void GameList::setFilterVisible(bool visibility) { 244void GameList::setFilterVisible(bool visibility) {
@@ -271,7 +273,9 @@ void GameList::DonePopulating() {
271 tree_view->setEnabled(true); 273 tree_view->setEnabled(true);
272 int rowCount = tree_view->model()->rowCount(); 274 int rowCount = tree_view->model()->rowCount();
273 search_field->setFilterResult(rowCount, rowCount); 275 search_field->setFilterResult(rowCount, rowCount);
274 search_field->setFocus(); 276 if (rowCount > 0) {
277 search_field->setFocus();
278 }
275} 279}
276 280
277void GameList::PopupContextMenu(const QPoint& menu_location) { 281void GameList::PopupContextMenu(const QPoint& menu_location) {
@@ -296,7 +300,6 @@ void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) {
296 !FileUtil::IsDirectory(dir_path.toStdString())) { 300 !FileUtil::IsDirectory(dir_path.toStdString())) {
297 LOG_ERROR(Frontend, "Could not find game list folder at %s", dir_path.toLocal8Bit().data()); 301 LOG_ERROR(Frontend, "Could not find game list folder at %s", dir_path.toLocal8Bit().data());
298 search_field->setFilterResult(0, 0); 302 search_field->setFilterResult(0, 0);
299 search_field->setFocus();
300 return; 303 return;
301 } 304 }
302 305