summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid/controllers/gesture.cpp2
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.cpp2
-rw-r--r--src/yuzu/game_list.cpp9
-rw-r--r--src/yuzu/game_list_p.h2
4 files changed, 8 insertions, 7 deletions
diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp
index 155808f6a..71545bf1f 100644
--- a/src/core/hle/service/hid/controllers/gesture.cpp
+++ b/src/core/hle/service/hid/controllers/gesture.cpp
@@ -33,7 +33,7 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u
33 shared_memory.header.timestamp = core_timing.GetCPUTicks(); 33 shared_memory.header.timestamp = core_timing.GetCPUTicks();
34 shared_memory.header.total_entry_count = 17; 34 shared_memory.header.total_entry_count = 17;
35 35
36 if (!IsControllerActivated()) { 36 if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) {
37 shared_memory.header.entry_count = 0; 37 shared_memory.header.entry_count = 0;
38 shared_memory.header.last_entry_index = 0; 38 shared_memory.header.last_entry_index = 0;
39 return; 39 return;
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp
index b5f8077be..8f56a0255 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.cpp
+++ b/src/core/hle/service/hid/controllers/touchscreen.cpp
@@ -33,7 +33,7 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin
33 shared_memory.header.timestamp = core_timing.GetCPUTicks(); 33 shared_memory.header.timestamp = core_timing.GetCPUTicks();
34 shared_memory.header.total_entry_count = 17; 34 shared_memory.header.total_entry_count = 17;
35 35
36 if (!IsControllerActivated()) { 36 if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) {
37 shared_memory.header.entry_count = 0; 37 shared_memory.header.entry_count = 0;
38 shared_memory.header.last_entry_index = 0; 38 shared_memory.header.last_entry_index = 0;
39 return; 39 return;
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 48b78d65f..827bc10e7 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -85,8 +85,8 @@ void GameListSearchField::setFilterResult(int visible, int total) {
85 label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); 85 label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible));
86} 86}
87 87
88bool GameListSearchField::isEmpty() const { 88QString GameListSearchField::filterText() const {
89 return edit_filter->text().isEmpty(); 89 return edit_filter->text();
90} 90}
91 91
92QString GameList::GetLastFilterResultItem() const { 92QString GameList::GetLastFilterResultItem() const {
@@ -236,9 +236,9 @@ void GameList::OnTextChanged(const QString& new_text) {
236 } else { 236 } else {
237 tree_view->setRowHidden(j, folder_index, true); 237 tree_view->setRowHidden(j, folder_index, true);
238 } 238 }
239 search_field->setFilterResult(result_count, children_total);
240 } 239 }
241 } 240 }
241 search_field->setFilterResult(result_count, children_total);
242 } 242 }
243} 243}
244 244
@@ -595,6 +595,7 @@ void GameList::AddCustomDirPopup(QMenu& context_menu, QModelIndex selected) {
595 connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] { 595 connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] {
596 UISettings::values.game_dirs.removeOne(game_dir); 596 UISettings::values.game_dirs.removeOne(game_dir);
597 item_model->invisibleRootItem()->removeRow(selected.row()); 597 item_model->invisibleRootItem()->removeRow(selected.row());
598 OnTextChanged(search_field->filterText());
598 }); 599 });
599} 600}
600 601
@@ -774,7 +775,7 @@ void GameList::RefreshGameDirectory() {
774void GameList::ToggleFavorite(u64 program_id) { 775void GameList::ToggleFavorite(u64 program_id) {
775 if (!UISettings::values.favorited_ids.contains(program_id)) { 776 if (!UISettings::values.favorited_ids.contains(program_id)) {
776 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), 777 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
777 !search_field->isEmpty()); 778 !search_field->filterText().isEmpty());
778 UISettings::values.favorited_ids.append(program_id); 779 UISettings::values.favorited_ids.append(program_id);
779 AddFavorite(program_id); 780 AddFavorite(program_id);
780 item_model->sort(tree_view->header()->sortIndicatorSection(), 781 item_model->sort(tree_view->header()->sortIndicatorSection(),
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index 7ca8ece23..978d27325 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -346,8 +346,8 @@ class GameListSearchField : public QWidget {
346public: 346public:
347 explicit GameListSearchField(GameList* parent = nullptr); 347 explicit GameListSearchField(GameList* parent = nullptr);
348 348
349 QString filterText() const;
349 void setFilterResult(int visible, int total); 350 void setFilterResult(int visible, int total);
350 bool isEmpty() const;
351 351
352 void clear(); 352 void clear();
353 void setFocus(); 353 void setFocus();