1
0
mirror of synced 2025-01-19 09:27:32 +01:00

impr: Remove "ImHex" from title bar if a file is loaded

This commit is contained in:
WerWolv 2023-12-07 11:19:08 +01:00
parent 9ba6d7ee1e
commit 00a24bc84b

View File

@ -121,7 +121,7 @@ namespace hex {
if (ProjectFile::hasPath()) { if (ProjectFile::hasPath()) {
// If a project is open, show the project name instead of the file name // If a project is open, show the project name instead of the file name
title += " - Project " + hex::limitStringLength(ProjectFile::getPath().stem().string(), 32); title = "Project " + hex::limitStringLength(ProjectFile::getPath().stem().string(), 32);
if (ImHexApi::Provider::isDirty()) if (ImHexApi::Provider::isDirty())
title += " (*)"; title += " (*)";
@ -129,7 +129,7 @@ namespace hex {
} else if (ImHexApi::Provider::isValid()) { } else if (ImHexApi::Provider::isValid()) {
auto provider = ImHexApi::Provider::get(); auto provider = ImHexApi::Provider::get();
if (provider != nullptr) { if (provider != nullptr) {
title += " - " + hex::limitStringLength(provider->getName(), 32); title = hex::limitStringLength(provider->getName(), 32);
if (provider->isDirty()) if (provider->isDirty())
title += " (*)"; title += " (*)";
@ -141,8 +141,12 @@ namespace hex {
this->m_windowTitle = title; this->m_windowTitle = title;
if (this->m_window != nullptr) if (this->m_window != nullptr) {
if (title != "ImHex")
title = "ImHex - " + title;
glfwSetWindowTitle(this->m_window, title.c_str()); glfwSetWindowTitle(this->m_window, title.c_str());
}
}); });
// Handle opening popups // Handle opening popups