From 96c1f588e43708defb672cb3b5e657bbf451d1dc Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Wed, 29 Dec 2021 19:52:54 -0500 Subject: [PATCH] Bug fix for bookmark preview popup window placement. Now is always placed left of scrollable area viewport. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 7 ++++++- src/drivers/Qt/TasEditor/TasEditorWindow.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index d54660d6..c446a2bc 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -1410,6 +1410,11 @@ void TasEditorWindow::updateHistoryItems(void) histTree->viewport()->update(); } //---------------------------------------------------------------------------- +QPoint TasEditorWindow::getPreviewPopupCoordinates(void) +{ + return bkmkBrnchStack->mapToGlobal(QPoint(0,0)); +} +//---------------------------------------------------------------------------- int TasEditorWindow::initModules(void) { // init modules @@ -6542,7 +6547,7 @@ bookmarkPreviewPopup::bookmarkPreviewPopup( int index, QWidget *parent ) free( pixBuf ); pixBuf = NULL; } - pos = parent->mapToGlobal(QPoint(0,0)); + pos = tasWin->getPreviewPopupCoordinates(); pos.setX( pos.x() - 300 ); diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.h b/src/drivers/Qt/TasEditor/TasEditorWindow.h index df186446..d6a3e387 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.h +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.h @@ -388,6 +388,8 @@ class TasEditorWindow : public QDialog bool handleInputColumnSet(int joy, int button); bool handleInputColumnSetUsingPattern(int joy, int button); + QPoint getPreviewPopupCoordinates(void); + protected: void closeEvent(QCloseEvent *event);