Enrich game list title (#19229)

Add on Game List title a brief recap of total number of entries in the
list and total number of Disc, HDD and all the other remaining types of
content.
This commit is contained in:
Antonino Di Guardo
2026-08-15 23:19:01 +00:00
committed by GitHub
parent fc93d932c8
commit f7eb0d8d76
3 changed files with 39 additions and 1 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ game_list_actions::content_info game_list_actions::GetContentInfo(const std::vec
}
}
text = tr("%0 selected games: %1 Disc Game - %2 not Disc Game\n").arg(games.size())
text = tr("%0 selected games - Disc: %1 | Other: %2\n").arg(games.size())
.arg(content_info.disc_list.size()).arg(games.size() - content_info.disc_list.size());
text += tr("\nDisc Game Info:\n");
+36
View File
@@ -346,6 +346,40 @@ bool game_list_frame::IsEntryVisible(const game_info& game, bool search_fallback
return is_visible && matches_category() && SearchMatchesApp(QString::fromStdString(game->info.name), serial, search_fallback);
}
// Show the amount of listed games (and the Disc/HDD/Other share) in the dock title
void game_list_frame::UpdateWindowTitle(const std::vector<game_info>& matching_apps)
{
const std::string cat_disc_game = cat::cat_disc_game.toStdString();
const std::string cat_hdd_game = cat::cat_hdd_game.toStdString();
usz disc_games = 0;
usz hdd_games = 0;
usz other_games = 0;
for (const auto& app : matching_apps)
{
if (!app) continue;
if (app->info.category == cat_disc_game)
{
disc_games++;
}
else if (app->info.category == cat_hdd_game)
{
hdd_games++;
}
else
{
other_games++;
}
}
setWindowTitle(tr("Game List (%0) - Disc: %1 | HDD: %2 | Other: %3")
.arg(matching_apps.size())
.arg(disc_games)
.arg(hdd_games)
.arg(other_games));
}
void game_list_frame::push_path(const std::string& path, std::vector<std::string>& legit_paths)
{
{
@@ -534,6 +568,8 @@ void game_list_frame::Refresh(const bool from_drive, const std::vector<std::stri
m_game_grid->populate(matching_apps, m_notes, m_titles, selected_items, m_play_hover_movies, m_play_hover_music);
RepaintIcons();
}
UpdateWindowTitle(matching_apps);
}
void game_list_frame::OnParsingFinished()
+2
View File
@@ -141,6 +141,8 @@ private:
std::set<std::string> m_done_paths;
};
void UpdateWindowTitle(const std::vector<game_info>& matching_apps);
void push_path(const std::string& path, std::vector<std::string>& legit_paths);
QString get_header_text(int col) const;