mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-01 21:17:44 -05:00
ux: Add close file button to file menu
This commit is contained in:
@@ -347,7 +347,7 @@ namespace hex {
|
||||
}
|
||||
|
||||
void ViewHexEditor::drawMenu() {
|
||||
auto provider = SharedData::currentProvider;
|
||||
auto &provider = SharedData::currentProvider;
|
||||
|
||||
if (ImGui::BeginMenu("hex.menu.file"_lang)) {
|
||||
if (ImGui::MenuItem("hex.view.hexeditor.menu.file.open_file"_lang, "CTRL + O")) {
|
||||
@@ -366,6 +366,12 @@ namespace hex {
|
||||
saveAs();
|
||||
}
|
||||
|
||||
if (ImGui::MenuItem("hex.view.hexeditor.menu.file.close", "", false, provider != nullptr && provider->isAvailable())) {
|
||||
EventManager::post<EventFileUnloaded>();
|
||||
delete SharedData::currentProvider;
|
||||
SharedData::currentProvider = nullptr;
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::MenuItem("hex.view.hexeditor.menu.file.open_project"_lang, "")) {
|
||||
|
||||
Reference in New Issue
Block a user