diff options
| author | 2021-09-30 18:54:21 -0400 | |
|---|---|---|
| committer | 2021-09-30 18:57:37 -0400 | |
| commit | 596323f89f8b127181cebf65ddf4bbc02792228c (patch) | |
| tree | 6d7d4e067dd2007cd66aa001a9d3c4d074fa85fc /src | |
| parent | Merge pull request #7061 from ameerj/dma-buffer-misc (diff) | |
| download | yuzu-596323f89f8b127181cebf65ddf4bbc02792228c.tar.gz yuzu-596323f89f8b127181cebf65ddf4bbc02792228c.tar.xz yuzu-596323f89f8b127181cebf65ddf4bbc02792228c.zip | |
main: Don't add an extra separator when the title version is absent
Some titles, such as homebrew, do not have any version string. Because
yuzu hard codes the title bar string assuming a version string is
preset, booting homebrew causes yuzu to add an extra separator with no
content between.
This uses a lambda expression to prevent that from happening.
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 3c2824362..7eec8f5bb 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -2913,8 +2913,13 @@ void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_vie | |||
| 2913 | if (title_name.empty()) { | 2913 | if (title_name.empty()) { |
| 2914 | setWindowTitle(QString::fromStdString(window_title)); | 2914 | setWindowTitle(QString::fromStdString(window_title)); |
| 2915 | } else { | 2915 | } else { |
| 2916 | const auto run_title = | 2916 | const auto run_title = [window_title, title_name, title_version, gpu_vendor]() { |
| 2917 | fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, gpu_vendor); | 2917 | if (title_version.empty()) { |
| 2918 | return fmt::format("{} | {} | {}", window_title, title_name, gpu_vendor); | ||
| 2919 | } | ||
| 2920 | return fmt::format("{} | {} | {} | {}", window_title, title_name, title_version, | ||
| 2921 | gpu_vendor); | ||
| 2922 | }(); | ||
| 2918 | setWindowTitle(QString::fromStdString(run_title)); | 2923 | setWindowTitle(QString::fromStdString(run_title)); |
| 2919 | } | 2924 | } |
| 2920 | } | 2925 | } |