early-access version 1646

main
pineappleEA 2021-05-01 19:07:04 +02:00
parent bc65fcb378
commit 67c21bcba9
3 changed files with 7 additions and 6 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1645. This is the source code for early-access 1646.
## Legal Notice ## Legal Notice

View File

@ -85,8 +85,8 @@ void GameListSearchField::setFilterResult(int visible, int total) {
label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible)); label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible));
} }
bool GameListSearchField::isEmpty() const { QString GameListSearchField::filterText() const {
return edit_filter->text().isEmpty(); return edit_filter->text();
} }
QString GameList::GetLastFilterResultItem() const { QString GameList::GetLastFilterResultItem() const {
@ -236,11 +236,11 @@ void GameList::OnTextChanged(const QString& new_text) {
} else { } else {
tree_view->setRowHidden(j, folder_index, true); tree_view->setRowHidden(j, folder_index, true);
} }
}
}
search_field->setFilterResult(result_count, children_total); search_field->setFilterResult(result_count, children_total);
} }
} }
}
}
void GameList::OnUpdateThemedIcons() { void GameList::OnUpdateThemedIcons() {
for (int i = 0; i < item_model->invisibleRootItem()->rowCount(); i++) { for (int i = 0; i < item_model->invisibleRootItem()->rowCount(); i++) {
@ -595,6 +595,7 @@ void GameList::AddCustomDirPopup(QMenu& context_menu, QModelIndex selected) {
connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] { connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] {
UISettings::values.game_dirs.removeOne(game_dir); UISettings::values.game_dirs.removeOne(game_dir);
item_model->invisibleRootItem()->removeRow(selected.row()); item_model->invisibleRootItem()->removeRow(selected.row());
OnTextChanged(search_field->filterText());
}); });
} }
@ -776,7 +777,7 @@ void GameList::RefreshGameDirectory() {
void GameList::ToggleFavorite(u64 program_id) { void GameList::ToggleFavorite(u64 program_id) {
if (!UISettings::values.favorited_ids.contains(program_id)) { if (!UISettings::values.favorited_ids.contains(program_id)) {
tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
!search_field->isEmpty()); !search_field->filterText().isEmpty());
UISettings::values.favorited_ids.append(program_id); UISettings::values.favorited_ids.append(program_id);
AddFavorite(program_id); AddFavorite(program_id);
item_model->sort(tree_view->header()->sortIndicatorSection(), item_model->sort(tree_view->header()->sortIndicatorSection(),

View File

@ -346,8 +346,8 @@ class GameListSearchField : public QWidget {
public: public:
explicit GameListSearchField(GameList* parent = nullptr); explicit GameListSearchField(GameList* parent = nullptr);
QString filterText() const;
void setFilterResult(int visible, int total); void setFilterResult(int visible, int total);
bool isEmpty() const;
void clear(); void clear();
void setFocus(); void setFocus();