aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/Menu.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/Menu.qml')
-rw-r--r--src/imports/controls/Menu.qml20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml
index 6692ef08..d9a97cee 100644
--- a/src/imports/controls/Menu.qml
+++ b/src/imports/controls/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,19 @@
****************************************************************************/
import QtQuick 2.6
-import Qt.labs.controls 1.0
-import Qt.labs.templates 1.0 as T
+import QtQuick.Controls 2.0
+import QtQuick.Templates 2.0 as T
T.Menu {
id: control
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
- //! [contentItem]
contentItem: ListView {
implicitHeight: contentHeight
model: control.contentModel
@@ -58,14 +59,11 @@ T.Menu {
ScrollIndicator.vertical: ScrollIndicator {}
}
- //! [contentItem]
- //! [background]
background: Rectangle {
implicitWidth: 200
- implicitHeight: 200
+ implicitHeight: 40
color: "#ffffff"
border.color: "#353637"
}
- //! [background]
}