aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Menu.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/material/Menu.qml')
-rw-r--r--src/imports/controls/material/Menu.qml37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml
index 755f5a56..b11c00b6 100644
--- a/src/imports/controls/material/Menu.qml
+++ b/src/imports/controls/material/Menu.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,18 +35,24 @@
****************************************************************************/
import QtQuick 2.6
-import Qt.labs.controls 1.0
-import Qt.labs.templates 1.0 as T
-import Qt.labs.controls.material 1.0
-import QtGraphicalEffects 1.0
+import QtQuick.Controls 2.0
+import QtQuick.Templates 2.0 as T
+import QtQuick.Controls.Material 2.0
+import QtQuick.Controls.Material.impl 2.0
T.Menu {
id: control
+ Material.elevation: 8
+
implicitWidth: Math.max(background ? background.implicitWidth : 0,
contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- implicitHeight: Math.min(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+ implicitHeight: Math.max(background ? background.implicitHeight : 0,
+ contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding
+
+ margins: 0
+ topPadding: 8
+ bottomPadding: 8
transformOrigin: Item.Top
@@ -62,7 +68,6 @@ T.Menu {
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
}
- //! [contentItem]
contentItem: ListView {
implicitHeight: contentHeight
@@ -75,23 +80,17 @@ T.Menu {
ScrollIndicator.vertical: ScrollIndicator {}
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 200
- implicitHeight: 200
+ implicitHeight: 48
radius: 3
color: control.Material.dialogColor
- layer.enabled: true
- layer.effect: DropShadow {
- verticalOffset: 1
- color: control.Material.dropShadowColor
- samples: 15
- spread: 0.5
+ layer.enabled: control.Material.elevation > 0
+ layer.effect: ElevationEffect {
+ elevation: control.Material.elevation
}
}
- //! [background]
}