From 2577a2f6374ddef655fb53573953096f4eb2aec7 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 6 Feb 2022 21:39:10 +0100 Subject: [PATCH] ux: Fixed docking to main window --- main/source/window/window.cpp | 4 ++-- plugins/builtin/source/content/welcome_screen.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index a5a62e14e..eed84bfe9 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -209,7 +209,7 @@ namespace hex { ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; - if (ImGui::Begin("DockSpace", nullptr, windowFlags)) { + if (ImGui::Begin("ImHexDockSpace", nullptr, windowFlags)) { auto drawList = ImGui::GetWindowDrawList(); ImGui::PopStyleVar(); auto sidebarPos = ImGui::GetCursorPos(); @@ -220,7 +220,7 @@ namespace hex { auto footerHeight = ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().FramePadding.y * 2 + 1_scaled; auto dockSpaceSize = ImVec2(ImHexApi::System::getMainWindowSize().x - sidebarWidth, ImGui::GetContentRegionAvail().y - footerHeight); - auto dockId = ImGui::DockSpace(ImGui::GetID("MainDock"), dockSpaceSize); + auto dockId = ImGui::DockSpace(ImGui::GetID("ImHexMainDock"), dockSpaceSize); ImHexApi::System::impl::setMainDockSpaceId(dockId); drawList->AddRectFilled(ImGui::GetWindowPos(), ImGui::GetWindowPos() + ImGui::GetWindowSize() - ImVec2(dockSpaceSize.x, footerHeight - ImGui::GetStyle().FramePadding.y - 1_scaled), ImGui::GetColorU32(ImGuiCol_MenuBarBg)); diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 829e569c8..97fdb409c 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -261,10 +261,10 @@ namespace hex::plugin::builtin { } static void drawWelcomeScreen() { - if (ImGui::Begin("DockSpace")) { + if (ImGui::Begin("ImHexDockSpace")) { if (!ImHexApi::Provider::isValid()) { static char title[256]; - ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("MainDock")); + ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock")); if (ImGui::Begin(title)) { ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(10_scaled, 10_scaled)); if (ImGui::BeginChild("Welcome Screen", ImVec2(0, 0), false, ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_NoScrollWithMouse)) {