Update qt window title to use the long game title rather than short game title.

This commit is contained in:
Riley Hawksworth 2024-03-30 23:26:43 +00:00 committed by OpenSauce
parent 5873e292e7
commit 1e22b780ae
2 changed files with 8 additions and 4 deletions

View File

@ -1238,8 +1238,11 @@ bool GMainWindow::LoadROM(const QString& filename) {
} }
std::string title; std::string title;
std::string title_long;
system.GetAppLoader().ReadTitle(title); system.GetAppLoader().ReadTitle(title);
system.GetAppLoader().ReadTitleLong(title_long);
game_title = QString::fromStdString(title); game_title = QString::fromStdString(title);
game_title_long = QString::fromStdString(title_long);
UpdateWindowTitle(); UpdateWindowTitle();
game_path = filename; game_path = filename;
@ -3054,14 +3057,14 @@ void GMainWindow::OnMoviePlaybackCompleted() {
void GMainWindow::UpdateWindowTitle() { void GMainWindow::UpdateWindowTitle() {
const QString full_name = QString::fromUtf8(Common::g_build_fullname); const QString full_name = QString::fromUtf8(Common::g_build_fullname);
if (game_title.isEmpty()) { if (game_title_long.isEmpty()) {
setWindowTitle(QStringLiteral("Lime %1").arg(full_name)); setWindowTitle(QStringLiteral("Lime %1").arg(full_name));
} else { } else {
setWindowTitle(QStringLiteral("Lime %1 | %2").arg(full_name, game_title)); setWindowTitle(QStringLiteral("Lime %1 | %2").arg(full_name, game_title_long));
render_window->setWindowTitle( render_window->setWindowTitle(
QStringLiteral("Lime %1 | %2 | %3").arg(full_name, game_title, tr("Primary Window"))); QStringLiteral("Lime %1 | %2 | %3").arg(full_name, game_title_long, tr("Primary Window")));
secondary_window->setWindowTitle( secondary_window->setWindowTitle(
QStringLiteral("Lime %1 | %2 | %3").arg(full_name, game_title, tr("Secondary Window"))); QStringLiteral("Lime %1 | %2 | %3").arg(full_name, game_title_long, tr("Secondary Window")));
} }
} }

View File

@ -321,6 +321,7 @@ private:
std::unique_ptr<EmuThread> emu_thread; std::unique_ptr<EmuThread> emu_thread;
// The title of the game currently running // The title of the game currently running
QString game_title; QString game_title;
QString game_title_long;
// The path to the game currently running // The path to the game currently running
QString game_path; QString game_path;