aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/imagine/Menu.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/controls/imagine/Menu.qml')
-rw-r--r--src/imports/controls/imagine/Menu.qml29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/imports/controls/imagine/Menu.qml b/src/imports/controls/imagine/Menu.qml
index 74dc09de..bf7540fd 100644
--- a/src/imports/controls/imagine/Menu.qml
+++ b/src/imports/controls/imagine/Menu.qml
@@ -34,20 +34,20 @@
**
****************************************************************************/
-import QtQuick 2.11
-import QtQuick.Controls 2.4
-import QtQuick.Templates 2.4 as T
-import QtQuick.Controls.Imagine 2.4
-import QtQuick.Controls.Imagine.impl 2.4
-import QtQuick.Window 2.11
+import QtQuick 2.12
+import QtQuick.Controls 2.5
+import QtQuick.Templates 2.5 as T
+import QtQuick.Controls.Imagine 2.5
+import QtQuick.Controls.Imagine.impl 2.5
+import QtQuick.Window 2.12
T.Menu {
id: control
- implicitWidth: Math.max(background ? background.implicitWidth : 0,
- contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- implicitHeight: Math.max(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding
+ implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
+ contentWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
+ contentHeight + topPadding + bottomPadding)
topMargin: background ? background.topInset : 0
leftMargin: background ? background.leftInset : 0
@@ -59,6 +59,11 @@ T.Menu {
rightPadding: background ? background.rightPadding : 0
bottomPadding: background ? background.bottomPadding : 0
+ topInset: background ? -background.topInset || 0 : 0
+ leftInset: background ? -background.leftInset || 0 : 0
+ rightInset: background ? -background.rightInset || 0 : 0
+ bottomInset: background ? -background.bottomInset || 0 : 0
+
delegate: MenuItem { }
contentItem: ListView {
@@ -72,10 +77,6 @@ T.Menu {
}
background: NinePatchImage {
- x: -leftInset; y: -topInset
- width: control.width + leftInset + rightInset
- height: control.height + topInset + bottomInset
-
source: Imagine.url + "menu-background"
NinePatchImageSelector on source {
states: [