diff --git a/src/common.h b/src/common.h index 3926fd5..4df8bca 100644 --- a/src/common.h +++ b/src/common.h @@ -5,7 +5,7 @@ #include "exif.h" #define PROG_NAME "PhotoQuick" -#define PROG_VERSION "4.16.1" +#define PROG_VERSION "4.16.2" #define COPYRIGHT_YEAR "2017-2023" #define AUTHOR_NAME "Arindam Chaudhuri" #define AUTHOR_EMAIL "ksharindam@gmail.com" diff --git a/src/dialogs.cpp b/src/dialogs.cpp index e722d8d..04bf7cd 100644 --- a/src/dialogs.cpp +++ b/src/dialogs.cpp @@ -169,6 +169,18 @@ PreviewDialog:: PreviewDialog(QLabel *canvas, QImage img, float scale) : QDialog timer->setSingleShot(true); timer->setInterval(800); connect(timer, SIGNAL(timeout()), this, SLOT(preview())); + QTimer::singleShot(30, this, SLOT(repositionWindow())); +} + +void +PreviewDialog:: repositionWindow() +{ + // move to bottom edge of Canvas, so that preview dialog does not guard the canvas + QPoint canvas_pos = canvas->mapToGlobal(QPoint(0,0)); + int canvas_bottom = canvas_pos.y() + canvas->height(); + QPoint pos = this->mapToGlobal(QPoint(0,0)); + int bottom = pos.y() + height(); + this->move(pos.x(), this->y()+ canvas_bottom - bottom); } void diff --git a/src/dialogs.h b/src/dialogs.h index e0e5d8c..9d7c6cd 100644 --- a/src/dialogs.h +++ b/src/dialogs.h @@ -66,6 +66,7 @@ class PreviewDialog : public QDialog public slots: void triggerPreview(); void preview(); + void repositionWindow(); };