citra-qt: update the separate window titles to use full_name and show Primary/Secondary identifier (#6712)

* citra-qt: update the separate window titles to use full_name and Primary/Secondary window identifier

* build_fullname: remove trailing space
This commit is contained in:
Vitor K 2023-07-25 09:51:46 -03:00 committed by GitHub
parent a537f56766
commit 19107cec4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -57,9 +57,7 @@ if (DEFINED ENV{CI})
set(BUILD_VERSION ${CMAKE_MATCH_1})
endif()
if (BUILD_VERSION)
# This leaves a trailing space on the last word, but we actually want that
# because of how it's styled in the title bar.
set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ")
set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION}")
else()
set(BUILD_FULLNAME "")
endif()

View File

@ -387,10 +387,6 @@ GRenderWindow::GRenderWindow(QWidget* parent_, EmuThread* emu_thread_, Core::Sys
bool is_secondary_)
: QWidget(parent_), EmuWindow(is_secondary_), emu_thread(emu_thread_), system{system_} {
setWindowTitle(QStringLiteral("Citra %1 | %2-%3")
.arg(QString::fromUtf8(Common::g_build_name),
QString::fromUtf8(Common::g_scm_branch),
QString::fromUtf8(Common::g_scm_desc)));
setAttribute(Qt::WA_AcceptTouchEvents);
auto layout = new QHBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);

View File

@ -2783,9 +2783,13 @@ void GMainWindow::UpdateWindowTitle() {
const QString full_name = QString::fromUtf8(Common::g_build_fullname);
if (game_title.isEmpty()) {
setWindowTitle(tr("Citra %1").arg(full_name));
setWindowTitle(QStringLiteral("Citra %1").arg(full_name));
} else {
setWindowTitle(tr("Citra %1| %2").arg(full_name, game_title));
setWindowTitle(QStringLiteral("Citra %1 | %2").arg(full_name, game_title));
render_window->setWindowTitle(
QStringLiteral("Citra %1 | %2 | %3").arg(full_name, game_title, tr("Primary Window")));
secondary_window->setWindowTitle(QStringLiteral("Citra %1 | %2 | %3")
.arg(full_name, game_title, tr("Secondary Window")));
}
}