Skip to content

Commit

Permalink
preview dialog does not guard the view of image
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharindam committed Oct 25, 2023
1 parent c2888e4 commit ca29163
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]"
Expand Down
12 changes: 12 additions & 0 deletions src/dialogs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/dialogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class PreviewDialog : public QDialog
public slots:
void triggerPreview();
void preview();
void repositionWindow();
};


Expand Down

0 comments on commit ca29163

Please sign in to comment.