From 6b288281743e0e7a33334bc2430481789ebf3175 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Mon, 22 May 2023 10:37:30 +0200 Subject: [PATCH] fix: Prevent horizontal scroll on welcome screen --- plugins/builtin/source/content/welcome_screen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/builtin/source/content/welcome_screen.cpp b/plugins/builtin/source/content/welcome_screen.cpp index 0df35fce3..bc0cdfb3e 100644 --- a/plugins/builtin/source/content/welcome_screen.cpp +++ b/plugins/builtin/source/content/welcome_screen.cpp @@ -384,10 +384,12 @@ namespace hex::plugin::builtin { static void drawWelcomeScreen() { 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("ImHexMainDock")); - if (ImGui::Begin(title)) { + static std::array title; + ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock")); + if (ImGui::Begin(title.data())) { ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(10_scaled, 10_scaled)); + + ImGui::SetNextWindowScroll(ImVec2(0.0F, -1.0F)); if (ImGui::BeginChild("Welcome Screen", ImVec2(0, 0), false, ImGuiWindowFlags_AlwaysUseWindowPadding)) { drawWelcomeScreenContent(); }