From c8b7f350ad2f3d9036430028aef54ba6e1f376e4 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 7 Jul 2022 07:16:38 +0200 Subject: [PATCH] ui: Fix rendering and default view initializing --- main/source/window/window.cpp | 2 +- plugins/builtin/source/content/welcome_screen.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main/source/window/window.cpp b/main/source/window/window.cpp index 99ceb3e20..2ffbd7468 100644 --- a/main/source/window/window.cpp +++ b/main/source/window/window.cpp @@ -197,7 +197,7 @@ namespace hex { ImGui::NewFrame(); ImGuiViewport *viewport = ImGui::GetMainViewport(); - ImGui::SetNextWindowPos(ImVec2(0, ImGui::GetTextLineHeightWithSpacing())); + ImGui::SetNextWindowPos(viewport->WorkPos); ImGui::SetNextWindowSize(ImHexApi::System::getMainWindowSize() - ImVec2(0, ImGui::GetTextLineHeightWithSpacing())); ImGui::SetNextWindowViewport(viewport->ID); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 022bcf469..c4818e497 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -32,7 +32,7 @@ namespace hex::plugin::builtin { static std::string s_tipOfTheDay; - [[maybe_unused]] static void loadDefaultLayout() { + static void loadDefaultLayout() { auto layouts = ContentRegistry::Interface::getLayouts(); if (!layouts.empty()) { @@ -434,8 +434,8 @@ namespace hex::plugin::builtin { }); EventManager::subscribe([](auto) { - //if (!isAnyViewOpen()) - //loadDefaultLayout(); + if (!isAnyViewOpen()) + loadDefaultLayout(); }); ContentRegistry::Interface::addMenuItem("hex.builtin.menu.file", 1075, [&] {