mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
impr: Clean up old layout stuff
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
#include <hex/api/content_registry.hpp>
|
||||
|
||||
#include <hex/ui/view.hpp>
|
||||
|
||||
namespace hex::plugin::builtin {
|
||||
|
||||
static void openViewAndDockTo(const std::string &unlocalizedName, ImGuiID dockId) {
|
||||
auto view = ContentRegistry::Views::getViewByName(unlocalizedName);
|
||||
|
||||
if (view != nullptr) {
|
||||
view->getWindowOpenState() = true;
|
||||
ImGui::DockBuilderDockWindow(view->getName().c_str(), dockId);
|
||||
}
|
||||
}
|
||||
|
||||
void registerLayouts() {
|
||||
|
||||
ContentRegistry::Interface::addLayout("hex.builtin.layouts.default", [](ImGuiID dockMain) {
|
||||
ImGuiID hexEditor = ImGui::DockBuilderSplitNode(dockMain, ImGuiDir_Left, 0.7F, nullptr, &dockMain);
|
||||
ImGuiID utils = ImGui::DockBuilderSplitNode(dockMain, ImGuiDir_Right, 0.8F, nullptr, &dockMain);
|
||||
ImGuiID patternData = ImGui::DockBuilderSplitNode(hexEditor, ImGuiDir_Down, 0.3F, nullptr, &hexEditor);
|
||||
ImGuiID inspector = ImGui::DockBuilderSplitNode(hexEditor, ImGuiDir_Right, 0.3F, nullptr, &hexEditor);
|
||||
|
||||
openViewAndDockTo("hex.builtin.view.hex_editor.name", hexEditor);
|
||||
openViewAndDockTo("hex.builtin.view.data_inspector.name", inspector);
|
||||
openViewAndDockTo("hex.builtin.view.pattern_data.name", patternData);
|
||||
|
||||
openViewAndDockTo("hex.builtin.view.pattern_editor.name", utils);
|
||||
openViewAndDockTo("hex.builtin.view.hashes.name", utils);
|
||||
openViewAndDockTo("hex.builtin.view.data_information.name", utils);
|
||||
openViewAndDockTo("hex.builtin.view.find.name", utils);
|
||||
openViewAndDockTo("hex.builtin.view.bookmarks.name", utils);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,6 @@ namespace hex::plugin::builtin {
|
||||
void registerHashes();
|
||||
void registerProviders();
|
||||
void registerDataFormatters();
|
||||
void registerLayouts();
|
||||
void registerMainMenuEntries();
|
||||
void createWelcomeScreen();
|
||||
void registerViews();
|
||||
@@ -70,7 +69,6 @@ IMHEX_PLUGIN_SETUP("Built-in", "WerWolv", "Default ImHex functionality") {
|
||||
addToolbarItems();
|
||||
addGlobalUIItems();
|
||||
|
||||
registerLayouts();
|
||||
registerMainMenuEntries();
|
||||
|
||||
handleBorderlessWindowMode();
|
||||
|
||||
Reference in New Issue
Block a user