Fix media viewer controls geometry updating.

This commit is contained in:
John Preston 2021-01-05 20:16:47 +04:00
parent 0bdb38753b
commit 613bf98283
2 changed files with 6 additions and 0 deletions

View File

@ -360,6 +360,7 @@ OverlayWidget::OverlayWidget()
setWindowFlags(Qt::FramelessWindowHint);
}
updateGeometry();
updateControlsGeometry();
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);
setMouseTracking(true);
@ -467,6 +468,10 @@ void OverlayWidget::updateGeometry() {
}
void OverlayWidget::resizeEvent(QResizeEvent *e) {
updateControlsGeometry();
}
void OverlayWidget::updateControlsGeometry() {
auto navSkip = 2 * st::mediaviewControlMargin + st::mediaviewControlSize;
_closeNav = myrtlrect(width() - st::mediaviewControlMargin - st::mediaviewControlSize, st::mediaviewControlMargin, st::mediaviewControlSize, st::mediaviewControlSize);
_closeNavIcon = style::centerrect(_closeNav, st::mediaviewClose);

View File

@ -275,6 +275,7 @@ private:
void updateDocSize();
void updateControls();
void updateActions();
void updateControlsGeometry();
void resizeCenteredControls();
void resizeContentByScreenSize();