From 831e6cb74ac1c353b0fd27bf82879130ef7be72f Mon Sep 17 00:00:00 2001 From: Riccardo Campo Date: Sat, 13 Jun 2026 11:18:12 +0200 Subject: [PATCH] PopupView: fix top and bottom overflow (https://github.com/audacity/audacity/issues/10660) --- .../uicomponents/qml/Muse/UiComponents/popupview.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/uicomponents/qml/Muse/UiComponents/popupview.cpp b/framework/uicomponents/qml/Muse/UiComponents/popupview.cpp index 5ef377afbc..b5b4252ae4 100644 --- a/framework/uicomponents/qml/Muse/UiComponents/popupview.cpp +++ b/framework/uicomponents/qml/Muse/UiComponents/popupview.cpp @@ -424,6 +424,16 @@ void PopupView::updateGeometry() movePos(m_globalPos.x() - (viewRect.right() - anchorRect.right()), m_globalPos.y()); } + if (viewRect.bottom() > anchorRect.bottom()) { + // move up to an area that doesn't fit + movePos(m_globalPos.x(), m_globalPos.y() + anchorRect.bottom() - viewRect.bottom()); + } + + if (viewRect.top() < anchorRect.top()) { + // move down to an area that doesn't fit + movePos(m_globalPos.x(), m_globalPos.y() - (viewRect.top() - anchorRect.top())); + } + if (!showArrow()) { if (popupPosition() == PopupPosition::Bottom || popupPosition() == PopupPosition::Top) { movePos(m_globalPos.x() - padding(), m_globalPos.y());