diff options
Diffstat (limited to 'src/gui/windowmanager.cpp')
-rw-r--r-- | src/gui/windowmanager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index e8c7f2425..822b3b3e9 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -163,6 +163,26 @@ void WindowManager::initTitle() #endif } +void WindowManager::updateTitle() +{ + const std::string str = settings.serverName; + if (str.empty()) + { + settings.windowCaption = strprintf("%s %s", + branding.getStringValue("appName").c_str(), + SMALL_VERSION); + } + else + { + settings.windowCaption = strprintf("%s %s - %s", + branding.getStringValue("appName").c_str(), + SMALL_VERSION, + str.c_str()); + } + SDL::SetWindowTitle(mainGraphics->getWindow(), + settings.windowCaption.c_str()); +} + void WindowManager::setFramerate(const unsigned int fpsLimit) { if (!fpsLimit) |