From 5b77f511d3697d83274f93a97a35c865e985a725 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 13 Dec 2023 23:44:53 +0100 Subject: [PATCH] impr: Added shadow to tutorial popups --- lib/libimhex/source/api/tutorial_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libimhex/source/api/tutorial_manager.cpp b/lib/libimhex/source/api/tutorial_manager.cpp index a3097c6ed..f5d54a0d8 100644 --- a/lib/libimhex/source/api/tutorial_manager.cpp +++ b/lib/libimhex/source/api/tutorial_manager.cpp @@ -109,8 +109,12 @@ namespace hex { if (windowPos.y < mainWindowPos.y) windowPos.y = mainWindowPos.y + 10_scaled; + auto &style = ImGui::GetStyle(); + + ImVec2 shadowOffset = ImVec2(ImCos(style.WindowShadowOffsetAngle), ImSin(style.WindowShadowOffsetAngle)) * style.WindowShadowOffsetDist; drawList->AddRectFilled(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowBg) | 0xFF000000); drawList->AddRect(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_Border)); + drawList->AddShadowRect(windowPos, windowPos + windowSize, ImGui::GetColorU32(ImGuiCol_WindowShadow), style.WindowShadowSize, shadowOffset, ImDrawFlags_ShadowCutOutShapeBackground); drawList->AddText(nullptr, 0.0F, windowPos + margin, ImGui::GetColorU32(ImGuiCol_Text), text, nullptr, windowSize.x - margin.x * 2); } }