ux: Show currently loaded file name in window name

This commit is contained in:
WerWolv
2021-03-29 22:44:23 +02:00
parent f263685e44
commit 0cc7004d0d
3 changed files with 15 additions and 0 deletions

View File

@@ -138,6 +138,13 @@ namespace hex {
glfwSetWindowShouldClose(this->m_window, true);
});
EventManager::subscribe<RequestChangeWindowTitle>(this, [this](std::string windowTitle) {
if (windowTitle.empty())
glfwSetWindowTitle(this->m_window, "ImHex");
else
glfwSetWindowTitle(this->m_window, ("ImHex - " + windowTitle).c_str());
});
this->initPlugins();
ContentRegistry::Settings::load();
@@ -163,6 +170,7 @@ namespace hex {
EventManager::unsubscribe<EventSettingsChanged>(this);
EventManager::unsubscribe<EventFileLoaded>(this);
EventManager::unsubscribe<RequestCloseImHex>(this);
EventManager::unsubscribe<RequestChangeWindowTitle>(this);
}
void Window::loop() {