ux: Add close file button to file menu
This commit is contained in:
parent
0cc7004d0d
commit
147aefc7e5
@ -155,6 +155,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.hexeditor.menu.file.open_file", "Datei öffnen..." },
|
||||
{ "hex.view.hexeditor.menu.file.save", "Speichern" },
|
||||
{ "hex.view.hexeditor.menu.file.save_as", "Speichern unter..." },
|
||||
{ "hex.view.hexeditor.menu.file.close", "Schliessen" },
|
||||
{ "hex.view.hexeditor.menu.file.open_project", "Projekt öffnen..." },
|
||||
{ "hex.view.hexeditor.menu.file.save_project", "Projekt speichern..." },
|
||||
{ "hex.view.hexeditor.menu.file.load_encoding_file", "Custom encoding laden..." },
|
||||
|
@ -155,6 +155,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.hexeditor.menu.file.open_file", "Open File..." },
|
||||
{ "hex.view.hexeditor.menu.file.save", "Save" },
|
||||
{ "hex.view.hexeditor.menu.file.save_as", "Save As..." },
|
||||
{ "hex.view.hexeditor.menu.file.close", "Close" },
|
||||
{ "hex.view.hexeditor.menu.file.open_project", "Open Project..." },
|
||||
{ "hex.view.hexeditor.menu.file.save_project", "Save Project..." },
|
||||
{ "hex.view.hexeditor.menu.file.load_encoding_file", "Load custom encoding..." },
|
||||
|
@ -155,6 +155,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.view.hexeditor.menu.file.open_file", "Apri File..." },
|
||||
{ "hex.view.hexeditor.menu.file.save", "Salva" },
|
||||
{ "hex.view.hexeditor.menu.file.save_as", "Salva come..." },
|
||||
// { "hex.view.hexeditor.menu.file.close", "" },
|
||||
{ "hex.view.hexeditor.menu.file.open_project", "Apri un Progetto..." },
|
||||
{ "hex.view.hexeditor.menu.file.save_project", "Salva Progetto..." },
|
||||
{ "hex.view.hexeditor.menu.file.load_encoding_file", "Carica una codifica personalizzata..." },
|
||||
|
@ -97,6 +97,7 @@ namespace hex {
|
||||
|
||||
/* Default Events */
|
||||
EVENT_DEF(EventFileLoaded, std::string);
|
||||
EVENT_DEF(EventFileUnloaded);
|
||||
EVENT_DEF(EventDataChanged);
|
||||
EVENT_DEF(EventPatternChanged);
|
||||
EVENT_DEF(EventFileDropped, std::string);
|
||||
|
@ -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, "")) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user