|
|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
|
#include <QDebug> |
|
|
|
|
#include <QPainter> |
|
|
|
|
#include <QTimer> |
|
|
|
|
|
|
|
|
|
#include "ImageOverlayDialog.h" |
|
|
|
|
|
|
|
|
@ -36,6 +37,13 @@ ImageOverlayDialog::ImageOverlayDialog(QPixmap image, QWidget *parent) |
|
|
|
|
setWindowState(Qt::WindowFullScreen); |
|
|
|
|
|
|
|
|
|
raise(); |
|
|
|
|
|
|
|
|
|
connect(this, SIGNAL(closing()), this, SLOT(closeDialog())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ImageOverlayDialog::closeDialog() |
|
|
|
|
{ |
|
|
|
|
QTimer::singleShot(100, this, &ImageOverlayDialog::reject); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// TODO: Move this into Utils
|
|
|
|
@ -110,9 +118,8 @@ void ImageOverlayDialog::mousePressEvent(QMouseEvent *event) |
|
|
|
|
if (event->button() != Qt::LeftButton) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
// FIXME: The main window needs double click to regain focus.
|
|
|
|
|
if (close_button_.contains(event->pos())) |
|
|
|
|
close(); |
|
|
|
|
emit closing(); |
|
|
|
|
else if (!content_.contains(event->pos())) |
|
|
|
|
close(); |
|
|
|
|
emit closing(); |
|
|
|
|
} |
|
|
|
|