aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-23 14:19:20 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-23 13:37:31 +0000
commitb0b3b7229d4f7d521840cb09c2d4c63f1c29726b (patch)
tree66324bb2f289fb9ac261f4cd16433f19f0b1961c /src/imports/controls
parentb9f5c47114c94974fcfe748057ffa8971b491e34 (diff)
Menu: set implicit size instead of explicit size
Change-Id: I68f25669379043bbe19b61428cd85dba7eb2ae70 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/controls')
-rw-r--r--src/imports/controls/Menu.qml8
-rw-r--r--src/imports/controls/material/Menu.qml8
-rw-r--r--src/imports/controls/universal/Menu.qml8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/imports/controls/Menu.qml b/src/imports/controls/Menu.qml
index 482b68a3..6692ef08 100644
--- a/src/imports/controls/Menu.qml
+++ b/src/imports/controls/Menu.qml
@@ -41,10 +41,10 @@ import Qt.labs.templates 1.0 as T
T.Menu {
id: control
- width: Math.max(background ? background.implicitWidth : 0,
- contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- height: Math.min(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+ 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)
//! [contentItem]
contentItem: ListView {
diff --git a/src/imports/controls/material/Menu.qml b/src/imports/controls/material/Menu.qml
index 86ab5c81..6a5c6f61 100644
--- a/src/imports/controls/material/Menu.qml
+++ b/src/imports/controls/material/Menu.qml
@@ -43,10 +43,10 @@ import QtGraphicalEffects 1.0
T.Menu {
id: control
- width: Math.max(background ? background.implicitWidth : 0,
- contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- height: Math.min(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+ 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)
enter: Transition {
// grow_fade_in
diff --git a/src/imports/controls/universal/Menu.qml b/src/imports/controls/universal/Menu.qml
index 765ca030..7cae65f1 100644
--- a/src/imports/controls/universal/Menu.qml
+++ b/src/imports/controls/universal/Menu.qml
@@ -42,10 +42,10 @@ import Qt.labs.controls.universal 1.0
T.Menu {
id: control
- width: Math.max(background ? background.implicitWidth : 0,
- contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
- height: Math.min(background ? background.implicitHeight : 0,
- contentItem ? contentItem.implicitHeight + topPadding + bottomPadding : 0)
+ 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)
//! [contentItem]
contentItem: ListView {