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

@@ -14,6 +14,8 @@
#undef __STRICT_ANSI__
#include <cstdio>
#include <filesystem>
namespace hex {
ViewHexEditor::ViewHexEditor(std::vector<lang::PatternData*> &patternData)
@@ -171,6 +173,10 @@ namespace hex {
});
}
});
EventManager::subscribe<EventFileLoaded>(this, [](std::string path) {
EventManager::post<RequestChangeWindowTitle>(std::filesystem::path(path).filename().string());
});
}
ViewHexEditor::~ViewHexEditor() {