From db256ea395e3b160bd161ddb5205870c29697150 Mon Sep 17 00:00:00 2001 From: Nico Bosshard Date: Sat, 6 May 2017 12:08:28 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20focus=20the=20search=20field=20if=20the?= =?UTF-8?q?=20game=20is=20empty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/citra_qt/game_list.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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() { } void GameList::setFilterFocus() { - search_field->setFocus(); + if (tree_view->model()->rowCount() > 0) { + search_field->setFocus(); + } } void GameList::setFilterVisible(bool visibility) { @@ -271,7 +273,9 @@ void GameList::DonePopulating() { tree_view->setEnabled(true); int rowCount = tree_view->model()->rowCount(); search_field->setFilterResult(rowCount, rowCount); - search_field->setFocus(); + if (rowCount > 0) { + search_field->setFocus(); + } } void GameList::PopupContextMenu(const QPoint& menu_location) { @@ -296,7 +300,6 @@ void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { !FileUtil::IsDirectory(dir_path.toStdString())) { LOG_ERROR(Frontend, "Could not find game list folder at %s", dir_path.toLocal8Bit().data()); search_field->setFilterResult(0, 0); - search_field->setFocus(); return; } -- cgit v1.2.3