Popup: resize the dimmer to match the overlay, not the window
The overlay adjusts its size based on the rotation, so it might have different dimensions than the window. The dimmer should always cover the entire overlay. Task-number: QTBUG-115536 Change-Id: Ic9c73dcb3c9bb3e4e2ece281c8437a00961fc9b1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commiteb653882af
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commitaf30efb07e
)
This commit is contained in:
parent
a4cc75c3bf
commit
07e269f62f
|
@ -12,6 +12,7 @@
|
|||
#include <QtQuick/private/qquickwindow_p.h>
|
||||
#include <QtQuick/private/qquickanimation_p.h>
|
||||
#include <QtQuick/private/qquicktransition_p.h>
|
||||
#include <QtQuickTemplates2/private/qquickoverlay_p.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -231,7 +232,9 @@ void QQuickDrawerPrivate::resizeOverlay()
|
|||
if (!dimmer || !window)
|
||||
return;
|
||||
|
||||
QRectF geometry(0, 0, window->width(), window->height());
|
||||
const QQuickOverlay *overlay = QQuickOverlay::overlay(window);
|
||||
|
||||
QRectF geometry(0, 0, overlay ? overlay->width() : 0, overlay ? overlay->height() : 0);
|
||||
|
||||
if (edge == Qt::LeftEdge || edge == Qt::RightEdge) {
|
||||
geometry.setY(popupItem->y());
|
||||
|
|
|
@ -933,8 +933,10 @@ void QQuickPopupPrivate::resizeOverlay()
|
|||
if (!dimmer)
|
||||
return;
|
||||
|
||||
qreal w = window ? window->width() : 0;
|
||||
qreal h = window ? window->height() : 0;
|
||||
const QQuickOverlay *overlay = QQuickOverlay::overlay(window);
|
||||
|
||||
qreal w = overlay ? overlay->width() : 0;
|
||||
qreal h = overlay ? overlay->height() : 0;
|
||||
dimmer->setSize(QSizeF(w, h));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue