forked from ShuriZma/suyu
1
0
Fork 0

Merge pull request #7111 from lat9nq/no-title-bar-version

main: Don't add an extra separator when the title version is absent
This commit is contained in:
bunnei 2021-10-03 00:27:08 -07:00 committed by GitHub
commit e209fff374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -2920,8 +2920,13 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie
if (title_name.empty()) { if (title_name.empty()) {
setWindowTitle(QString::fromStdString(window_title)); setWindowTitle(QString::fromStdString(window_title));
} else { } else {
const auto run_title = const auto run_title = [window_title, title_name, title_version, gpu_vendor]() {
fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor); if (title_version.empty()) {
return fmt::format("{} | {} | {}", window_title, title_name, gpu_vendor);
}
return fmt::format("{} | {} | {} | {}", window_title, title_name, title_version,
gpu_vendor);
}();
setWindowTitle(QString::fromStdString(run_title)); setWindowTitle(QString::fromStdString(run_title));
} }
} }