diff --git a/lib/external/libwolv b/lib/external/libwolv index aaf491cbc..e4891c89b 160000 --- a/lib/external/libwolv +++ b/lib/external/libwolv @@ -1 +1 @@ -Subproject commit aaf491cbc71bb9b610671b82a8c8262af5061212 +Subproject commit e4891c89b6df5e3dd7ac976f12fbcc8d850b3c8d diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 7504d1dae..761d0382c 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -1192,7 +1192,9 @@ namespace hex { handler.ReadOpenFn = [](ImGuiContext *ctx, ImGuiSettingsHandler *, const char *) -> void* { return ctx; }; - handler.ReadLineFn = [](ImGuiContext *, ImGuiSettingsHandler *, void *, const char *line) { + handler.ReadLineFn = [](ImGuiContext *, ImGuiSettingsHandler *handler, void *, const char *line) { + Window* window = static_cast(handler->UserData); + for (auto &[name, view] : ContentRegistry::Views::impl::getEntries()) { std::string format = view->getUnlocalizedName() + "=%d"; sscanf(line, format.c_str(), &view->getWindowOpenState()); @@ -1201,6 +1203,15 @@ namespace hex { std::string format = name + "=%d"; sscanf(line, format.c_str(), &detached); } + + int width = 0, height = 0; + sscanf(line, "MainWindowSize=%d,%d", &width, &height); + + if (width > 0 && height > 0) { + TaskManager::doLater([width, height, window]{ + glfwSetWindowSize(window->m_window, width, height); + }); + } }; handler.WriteAllFn = [](ImGuiContext *, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf) { diff --git a/plugins/builtin/romfs/layouts/minimal.hexlyt b/plugins/builtin/romfs/layouts/minimal.hexlyt new file mode 100644 index 000000000..255c3329b --- /dev/null +++ b/plugins/builtin/romfs/layouts/minimal.hexlyt @@ -0,0 +1,192 @@ +[Window][ImHexDockSpace] +Pos=0,38 +Size=2560,1513 +Collapsed=0 + +[Window][###hex.builtin.view.settings.name] +Pos=259,200 +Size=700,400 +Collapsed=0 + +[Window][###hex.builtin.view.hex_editor.name] +Pos=0,76 +Size=1140,980 +Collapsed=0 +DockId=0x00000007,0 + +[Window][###hex.builtin.view.data_inspector.name] +Pos=1142,76 +Size=553,980 +Collapsed=0 +DockId=0x00000008,0 + +[Window][###hex.builtin.view.pattern_data.name] +Pos=0,1058 +Size=1695,445 +Collapsed=0 +DockId=0x00000006,0 + +[Window][###hex.builtin.view.pattern_editor.name] +Pos=1697,76 +Size=863,1427 +Collapsed=0 +DockId=0x00000004,0 + +[Window][###hex.builtin.view.hashes.name] +Pos=1697,76 +Size=863,1427 +Collapsed=0 +DockId=0x00000004,4 + +[Window][###hex.builtin.view.find.name] +Pos=1697,76 +Size=863,1427 +Collapsed=0 +DockId=0x00000004,3 + +[Window][###hex.builtin.view.bookmarks.name] +Pos=1697,76 +Size=863,1427 +Collapsed=0 +DockId=0x00000004,2 + +[Window][###hex.builtin.view.information.name] +Pos=-1889,-120 +Size=510,420 +Collapsed=0 + +[Window][###hex.builtin.view.yara.name] +Pos=720,38 +Size=560,660 +Collapsed=0 + +[Window][###hex.builtin.view.store.name] +Pos=562,201 +Size=900,700 +Collapsed=0 + +[Window][###hex.builtin.view.diff.name] +Pos=1233,38 +Size=687,1021 +Collapsed=0 + +[Window][###hex.builtin.view.provider_settings.name] +Pos=822,38 +Size=637,720 +Collapsed=0 + +[Window][###hex.builtin.view.provider_settings.load_popup] +Pos=585,322 +Size=314,208 +Collapsed=0 + +[Window][###hex.builtin.view.patches.name] +Pos=-1889,-120 +Size=510,420 +Collapsed=0 + +[Window][###hex.builtin.view.data_processor.name] +Pos=1697,76 +Size=863,1427 +Collapsed=0 +DockId=0x00000004,1 + +[Window][###hex.builtin.view.tools.name] +ViewportPos=952,218 +ViewportId=0x9B385D8A +Size=1306,1600 +Collapsed=0 + +[Window][###hex.builtin.view.theme_manager.name] +Pos=391,302 +Size=469,400 +Collapsed=0 + +[Window][###hex.builtin.tools.invariant_multiplication] +Pos=-1826,300 +Size=600,232 +Collapsed=0 + +[Window][###hex.builtin.tools.regex_replacer] +Pos=-2091,104 +Size=600,305 +Collapsed=0 + +[Window][###hex.builtin.tools.calc] +Pos=-1811,118 +Size=600,402 +Collapsed=0 + +[Window][###hex.builtin.tools.permissions] +Pos=423,296 +Size=600,220 +Collapsed=0 + +[Window][###hex.builtin.view.help.about.name] +Pos=214,201 +Size=600,350 +Collapsed=0 + +[Window][###hex.builtin.view.constants.name] +Pos=419,-124 +Size=652,660 +Collapsed=0 + +[Window][###hex.builtin.view.disassembler.name] +Pos=1004,-204 +Size=1336,1320 +Collapsed=0 + +[Docking][Data] +DockSpace ID=0x81A8BB71 Window=0xF9B0A590 Pos=161,350 Size=2560,1427 Split=X + DockNode ID=0x00000001 Parent=0x81A8BB71 SizeRef=847,0 Split=Y + DockNode ID=0x00000005 Parent=0x00000001 SizeRef=0,44 Split=X Selected=0x5708C63F + DockNode ID=0x00000007 Parent=0x00000005 SizeRef=1140,701 Selected=0x5708C63F + DockNode ID=0x00000008 Parent=0x00000005 SizeRef=553,701 Selected=0xFBA7A393 + DockNode ID=0x00000006 Parent=0x00000001 SizeRef=0,20 Selected=0x7AD1CDDD + DockNode ID=0x00000002 Parent=0x81A8BB71 SizeRef=431,0 Split=X + DockNode ID=0x00000003 Parent=0x00000002 SizeRef=12,0 + DockNode ID=0x00000004 Parent=0x00000002 SizeRef=52,0 Selected=0xCACA884B + +[ImHex][General] +hex.builtin.view.achievements.name=0 +hex.builtin.view.bookmarks.name=0 +hex.builtin.view.command_palette.name=0 +hex.builtin.view.constants.name=0 +hex.builtin.view.data_inspector.name=0 +hex.builtin.view.data_processor.name=0 +hex.builtin.view.diff.name=0 +hex.builtin.view.disassembler.name=0 +hex.builtin.view.find.name=0 +hex.builtin.view.hashes.name=0 +hex.builtin.view.help.about.name=0 +hex.builtin.view.hex_editor.name=1 +hex.builtin.view.highlight_rules.name=0 +hex.builtin.view.information.name=0 +hex.builtin.view.logs.name=0 +hex.builtin.view.patches.name=0 +hex.builtin.view.pattern_data.name=0 +hex.builtin.view.pattern_editor.name=0 +hex.builtin.view.provider_settings.name=0 +hex.builtin.view.settings.name=0 +hex.builtin.view.store.name=0 +hex.builtin.view.theme_manager.name=0 +hex.builtin.view.tools.name=0 +hex.builtin.view.yara.name=0 +hex.windows.view.tty_console.name=0 +hex.builtin.tools.demangler=0 +hex.builtin.tools.ascii_table=0 +hex.builtin.tools.regex_replacer=0 +hex.builtin.tools.color=0 +hex.builtin.tools.calc=0 +hex.builtin.tools.graphing=0 +hex.builtin.tools.base_converter=0 +hex.builtin.tools.byte_swapper=0 +hex.builtin.tools.permissions=0 +hex.builtin.tools.wiki_explain=0 +hex.builtin.tools.file_tools=0 +hex.builtin.tools.ieee754=0 +hex.builtin.tools.invariant_multiplication=0 +hex.builtin.tools.tcp_client_server=0 +hex.builtin.tools.euclidean_algorithm=0 +MainWindowSize=720,1000 diff --git a/plugins/builtin/source/content/main_menu_items.cpp b/plugins/builtin/source/content/main_menu_items.cpp index 86d07a6f9..7f88707c9 100644 --- a/plugins/builtin/source/content/main_menu_items.cpp +++ b/plugins/builtin/source/content/main_menu_items.cpp @@ -551,13 +551,15 @@ namespace hex::plugin::builtin { ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.layout" }, 1200); ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.layout" }, 2000, [] { - if (ImGui::MenuItem("hex.builtin.layouts.default"_lang, "", false, ImHexApi::Provider::isValid())) { - LayoutManager::loadString(std::string(romfs::get("layouts/default.hexlyt").string())); + for (const auto &path : romfs::list("layouts")) { + if (ImGui::MenuItem(wolv::util::capitalizeString(path.stem().string()).c_str(), "", false, ImHexApi::Provider::isValid())) { + LayoutManager::loadString(std::string(romfs::get(path).string())); + } } bool shift = ImGui::GetIO().KeyShift; for (auto &[name, path] : LayoutManager::getLayouts()) { - if (ImGui::MenuItem(hex::format("{}{}", name, shift ? " [X]" : "").c_str(), "", false, ImHexApi::Provider::isValid())) { + if (ImGui::MenuItem(hex::format("{}{}", name, shift ? " " ICON_VS_X : "").c_str(), "", false, ImHexApi::Provider::isValid())) { if (shift) { wolv::io::fs::remove(path); LayoutManager::reload();