diff options
| author | 2019-10-05 00:10:04 -0400 | |
|---|---|---|
| committer | 2019-10-05 00:10:04 -0400 | |
| commit | 57fe7fdec0a04a41cfca228a20155dcb39971c81 (patch) | |
| tree | 7975ee043368dddaf74071304ebd8dffb9035d59 /src | |
| parent | common: Add additional SCM revision fields (diff) | |
| download | yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.gz yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.tar.xz yuzu-57fe7fdec0a04a41cfca228a20155dcb39971c81.zip | |
qt: Change titlebar formatting
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 2d82df739..197e704b4 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1889,15 +1889,24 @@ void GMainWindow::OnCaptureScreenshot() { | |||
| 1889 | } | 1889 | } |
| 1890 | 1890 | ||
| 1891 | void GMainWindow::UpdateWindowTitle(const QString& title_name) { | 1891 | void GMainWindow::UpdateWindowTitle(const QString& title_name) { |
| 1892 | const QString full_name = QString::fromUtf8(Common::g_build_fullname); | 1892 | const auto full_name = std::string(Common::g_build_fullname); |
| 1893 | const QString branch_name = QString::fromUtf8(Common::g_scm_branch); | 1893 | const auto branch_name = std::string(Common::g_scm_branch); |
| 1894 | const QString description = QString::fromUtf8(Common::g_scm_desc); | 1894 | const auto description = std::string(Common::g_scm_desc); |
| 1895 | const auto build_id = std::string(Common::g_build_id); | ||
| 1896 | |||
| 1897 | const auto date = | ||
| 1898 | QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd")).toStdString(); | ||
| 1895 | 1899 | ||
| 1896 | if (title_name.isEmpty()) { | 1900 | if (title_name.isEmpty()) { |
| 1897 | setWindowTitle(QStringLiteral("yuzu %1| %2-%3").arg(full_name, branch_name, description)); | 1901 | const auto fmt = std::string(Common::g_title_bar_format_idle); |
| 1902 | setWindowTitle(QString::fromStdString(fmt::format(fmt.empty() ? "yuzu {0}| {1}-{2}" : fmt, | ||
| 1903 | full_name, branch_name, description, | ||
| 1904 | std::string{}, date, build_id))); | ||
| 1898 | } else { | 1905 | } else { |
| 1899 | setWindowTitle(QStringLiteral("yuzu %1| %4 | %2-%3") | 1906 | const auto fmt = std::string(Common::g_title_bar_format_idle); |
| 1900 | .arg(full_name, branch_name, description, title_name)); | 1907 | setWindowTitle(QString::fromStdString( |
| 1908 | fmt::format(fmt.empty() ? "yuzu {0}| {3} | {1}-{2}" : fmt, full_name, branch_name, | ||
| 1909 | description, std::string{}, date, build_id))); | ||
| 1901 | } | 1910 | } |
| 1902 | } | 1911 | } |
| 1903 | 1912 | ||