fix: Make title bar backdrop stay where it is on resize

This commit is contained in:
WerWolv
2025-02-16 11:40:09 +01:00
parent 870aeb34fc
commit 8777a85630

View File

@@ -41,9 +41,9 @@ namespace hex::plugin::builtin {
if (!s_showTitlebarBackDrop)
return;
const auto size = ImHexApi::System::getMainWindowSize();
const auto pos = ImHexApi::System::getMainWindowPosition() - ImVec2(0, size.y / 2 - 20_scaled);
ImGui::GetWindowDrawList()->AddShadowCircle(pos, size.x / 4, ImGui::GetColorU32(ImGuiCol_ButtonActive, 0.8), size.x / 4, ImVec2());
const auto diameter = 800_scaled;
const auto pos = ImHexApi::System::getMainWindowPosition() - ImVec2(0, diameter / 2);
ImGui::GetWindowDrawList()->AddShadowCircle(pos, diameter / 2, ImGui::GetColorU32(ImGuiCol_ButtonActive, 0.8), diameter / 4, ImVec2());
}
void createNestedMenu(std::span<const UnlocalizedString> menuItems, const char *icon, const Shortcut &shortcut, View *view, const ContentRegistry::Interface::impl::MenuCallback &callback, const ContentRegistry::Interface::impl::EnabledCallback &enabledCallback, const ContentRegistry::Interface::impl::SelectedCallback &selectedCallback) {