diff --git a/plugins/builtin/include/content/popups/popup_text_input.hpp b/plugins/builtin/include/content/popups/popup_text_input.hpp index f90bb601e54da..41f5543c1ec8a 100644 --- a/plugins/builtin/include/content/popups/popup_text_input.hpp +++ b/plugins/builtin/include/content/popups/popup_text_input.hpp @@ -18,7 +18,12 @@ namespace hex::plugin::builtin { ImGui::NewLine(); ImGui::PushItemWidth(-1); - ImGui::SetKeyboardFocusHere(); + + if (this->m_justOpened) { + ImGui::SetKeyboardFocusHere(); + this->m_justOpened = false; + } + ImGui::InputTextIcon("##input", ICON_VS_SYMBOL_KEY, this->m_input); ImGui::PopItemWidth(); @@ -57,6 +62,7 @@ namespace hex::plugin::builtin { std::string m_message; std::function m_function; + bool m_justOpened = true; }; } \ No newline at end of file diff --git a/plugins/builtin/source/content/main_menu_items.cpp b/plugins/builtin/source/content/main_menu_items.cpp index 22690f33aaa23..bde30cb58f8b5 100644 --- a/plugins/builtin/source/content/main_menu_items.cpp +++ b/plugins/builtin/source/content/main_menu_items.cpp @@ -456,9 +456,15 @@ namespace hex::plugin::builtin { LayoutManager::loadString(std::string(romfs::get("layouts/default.hexlyt").string())); } + bool shift = ImGui::GetIO().KeyShift; for (auto &[name, path] : LayoutManager::getLayouts()) { - if (ImGui::MenuItem(name.c_str(), "", false, ImHexApi::Provider::isValid())) { - LayoutManager::load(path); + if (ImGui::MenuItem(hex::format("{}{}", name, shift ? " [X]" : "").c_str(), "", false, ImHexApi::Provider::isValid())) { + if (shift) { + wolv::io::fs::remove(path); + LayoutManager::reload(); + } + else + LayoutManager::load(path); } } });