React to moveEvent in media viewer

This commit is contained in:
Ilya Fedin 2021-03-05 20:58:32 +04:00 committed by John Preston
parent 99b7f051c7
commit 1fc24398a0
2 changed files with 14 additions and 6 deletions

View File

@ -481,13 +481,20 @@ void OverlayWidget::updateGeometry() {
setGeometry(available);
}
void OverlayWidget::moveEvent(QMoveEvent *e) {
const auto newPos = e->pos();
DEBUG_LOG(("Viewer Pos: Moved to %1, %2")
.arg(newPos.x())
.arg(newPos.y()));
moveToScreen();
OverlayParent::moveEvent(e);
}
void OverlayWidget::resizeEvent(QResizeEvent *e) {
const auto newGeometry = geometry();
DEBUG_LOG(("Viewer Pos: Resized to %1, %2, %3, %4")
.arg(newGeometry.x())
.arg(newGeometry.y())
.arg(newGeometry.width())
.arg(newGeometry.height()));
const auto newSize = e->size();
DEBUG_LOG(("Viewer Pos: Resized to %1, %2")
.arg(newSize.width())
.arg(newSize.height()));
updateControlsGeometry();
OverlayParent::resizeEvent(e);
}

View File

@ -170,6 +170,7 @@ private:
};
void paintEvent(QPaintEvent *e) override;
void moveEvent(QMoveEvent *e) override;
void resizeEvent(QResizeEvent *e) override;
void keyPressEvent(QKeyEvent *e) override;