diff --git a/toonz/sources/toonz/xshcolumnviewer.cpp b/toonz/sources/toonz/xshcolumnviewer.cpp index 5fb402e..3bd9400 100644 --- a/toonz/sources/toonz/xshcolumnviewer.cpp +++ b/toonz/sources/toonz/xshcolumnviewer.cpp @@ -62,6 +62,7 @@ #include #include #include +#include #include //============================================================================= @@ -2329,6 +2330,19 @@ void ColumnArea::mouseReleaseEvent(QMouseEvent *event) { m_columnTransparencyPopup->move(event->globalPos().x() + x, event->globalPos().y() - y); + // make sure the popup doesn't go off the screen to the right + QDesktopWidget *desktop = qApp->desktop(); + QRect screenRect = desktop->screenGeometry(app->getMainWindow()); + + int popupLeft = event->globalPos().x() + x; + int popupRight = popupLeft + m_columnTransparencyPopup->width(); + + if (popupRight > screenRect.right()) { + int distance = popupRight - screenRect.right(); + m_columnTransparencyPopup->move(m_columnTransparencyPopup->x() - distance, + m_columnTransparencyPopup->y()); + } + openTransparencyPopup(); } } else if (m_doOnRelease == ToggleAllPreviewVisible) {