Consider virtual screen when determining dock widget visibility.
Task-number: QTBUG-32260 Change-Id: I8b28e3869a6e3b1ed12a311dfa0100979098fc4b Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
e602003f87
commit
6c37fb70d6
@ -49,6 +49,7 @@
|
||||
#include <qevent.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qwindow.h>
|
||||
#include <qscreen.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qrubberband.h>
|
||||
#include <qstylepainter.h>
|
||||
@ -1387,9 +1388,17 @@ bool QDockWidget::event(QEvent *event)
|
||||
d->toggleViewAction->setChecked(false);
|
||||
emit visibilityChanged(false);
|
||||
break;
|
||||
case QEvent::Show:
|
||||
case QEvent::Show: {
|
||||
d->toggleViewAction->setChecked(true);
|
||||
emit visibilityChanged(geometry().right() >= 0 && geometry().bottom() >= 0);
|
||||
QPoint parentTopLeft(0, 0);
|
||||
if (isWindow()) {
|
||||
if (const QWindow *window = windowHandle())
|
||||
parentTopLeft = window->screen()->availableVirtualGeometry().topLeft();
|
||||
else
|
||||
parentTopLeft = QGuiApplication::primaryScreen()->availableVirtualGeometry().topLeft();
|
||||
}
|
||||
emit visibilityChanged(geometry().right() >= parentTopLeft.x() && geometry().bottom() >= parentTopLeft.y());
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case QEvent::ApplicationLayoutDirectionChange:
|
||||
|
Loading…
x
Reference in New Issue
Block a user