diff options
Diffstat (limited to 'src/imports/controls/material/Drawer.qml')
-rw-r--r-- | src/imports/controls/material/Drawer.qml | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/src/imports/controls/material/Drawer.qml b/src/imports/controls/material/Drawer.qml index 133ea9c8..1c15e689 100644 --- a/src/imports/controls/material/Drawer.qml +++ b/src/imports/controls/material/Drawer.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Labs Controls module of the Qt Toolkit. +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage @@ -35,19 +35,33 @@ ****************************************************************************/ import QtQuick 2.6 -import QtQuick.Window 2.2 -import Qt.labs.templates 1.0 as T -import Qt.labs.controls.material 1.0 +import QtQuick.Templates 2.0 as T +import QtQuick.Controls.Material 2.0 +import QtQuick.Controls.Material.impl 2.0 T.Drawer { id: control - parent: T.ApplicationWindow.overlay || Window.contentItem - width: parent ? parent.width : 0 // TODO: Window.width - height: parent ? parent.height : 0 // TODO: Window.height + parent: T.ApplicationWindow.overlay - // TODO: make this a proper transition - animation: SmoothedAnimation { - velocity: 5 + implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) + + contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) + contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) + + enter: Transition { SmoothedAnimation { velocity: 5 } } + exit: Transition { SmoothedAnimation { velocity: 5 } } + + contentItem: Item { } + + background: Rectangle { + color: control.Material.dialogColor + + layer.enabled: control.position > 0 + layer.effect: ElevationEffect { + elevation: 16 + fullHeight: true + } } } |