aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-21 11:56:08 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-21 21:39:41 +0000
commit175d0ea3f80af0ca32baec489d8ea66dd4ee3418 (patch)
tree2e4d30797a32967195b9db1dccde0bb8b8f119e5 /src/imports
parentaae5b793666091a780e63b68b2a0426f8edd6174 (diff)
Drawer: reparent to the overlay by default
Drawer is a special type of popup that always resides at one of the window edges. Therefore it makes sense for drawers to operate on window coordinates. Re-parenting drawers to the window overlay achieves that. Now that the window overlay is guaranteed to always exist and the ApplicationWindow.overlay attached property works even with plain QML Window, we can reliably use it as a parent for Drawer. Task-number: QTBUG-53168 Change-Id: I37c727001350217ea1d2d9c52d73b4cae44d7c8d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/controls/Drawer.qml2
-rw-r--r--src/imports/controls/material/Drawer.qml2
-rw-r--r--src/imports/controls/universal/Drawer.qml2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/imports/controls/Drawer.qml b/src/imports/controls/Drawer.qml
index 8cf4e5e5..9791bf0c 100644
--- a/src/imports/controls/Drawer.qml
+++ b/src/imports/controls/Drawer.qml
@@ -40,6 +40,8 @@ import QtQuick.Templates 2.0 as T
T.Drawer {
id: control
+ parent: T.ApplicationWindow.overlay
+
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml
index b3ee94f7..1c15e689 100644
--- a/src/imports/controls/material/Drawer.qml
+++ b/src/imports/controls/material/Drawer.qml
@@ -42,6 +42,8 @@ import QtQuick.Controls.Material.impl 2.0
T.Drawer {
id: control
+ parent: T.ApplicationWindow.overlay
+
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)
diff --git a/src/imports/controls/universal/Drawer.qml b/src/imports/controls/universal/Drawer.qml
index 95fef8d1..84831323 100644
--- a/src/imports/controls/universal/Drawer.qml
+++ b/src/imports/controls/universal/Drawer.qml
@@ -41,6 +41,8 @@ import QtQuick.Controls.Universal 2.0
T.Drawer {
id: control
+ parent: T.ApplicationWindow.overlay
+
implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding)