From 44fd9bff6776de3a7b66e8b33412a554551c50c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 8 Dec 2015 02:32:03 +0100 Subject: [PATCH] sync with mobilecomponents f4d5d19fc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Kills a warning in ContextDrawer. - Improves sizing of menu icons. - Fixes icon rendering in menues. Signed-off-by: Sebastian Kügler --- qt-mobile/qml/mobilecomponents/ContextDrawer.qml | 3 +++ qt-mobile/qml/mobilecomponents/GlobalDrawer.qml | 2 +- qt-mobile/qml/mobilecomponents/Icon.qml | 7 +++++-- qt-mobile/qml/mobilecomponents/Page.qml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/qt-mobile/qml/mobilecomponents/ContextDrawer.qml b/qt-mobile/qml/mobilecomponents/ContextDrawer.qml index 07de5b88d..aea4a5ca5 100644 --- a/qt-mobile/qml/mobilecomponents/ContextDrawer.qml +++ b/qt-mobile/qml/mobilecomponents/ContextDrawer.qml @@ -37,6 +37,9 @@ OverlayDrawer { id: menu interactive: contentHeight > height model: { + if (typeof root.actions == "undefined") { + return null; + } if (root.actions.length == 0) { return null; } else { diff --git a/qt-mobile/qml/mobilecomponents/GlobalDrawer.qml b/qt-mobile/qml/mobilecomponents/GlobalDrawer.qml index 1632da122..ff379b093 100644 --- a/qt-mobile/qml/mobilecomponents/GlobalDrawer.qml +++ b/qt-mobile/qml/mobilecomponents/GlobalDrawer.qml @@ -146,7 +146,7 @@ OverlayDrawer { visible: level > 0 enabled: true RowLayout { - height: implicitHeight + Units.smallSpacing * 2 + height: Units.iconSizes.smallMedium + Units.smallSpacing * 2 anchors { left: parent.left } diff --git a/qt-mobile/qml/mobilecomponents/Icon.qml b/qt-mobile/qml/mobilecomponents/Icon.qml index b28624dbf..59cfaf054 100644 --- a/qt-mobile/qml/mobilecomponents/Icon.qml +++ b/qt-mobile/qml/mobilecomponents/Icon.qml @@ -27,13 +27,16 @@ Item { property alias smooth: image.smooth property bool active: false property bool valid: image.status == Image.Ready - implicitWidth: Math.min(image.sourceSize.width, Units.iconSizes.medium) - implicitHeight: Math.min(image.sourceSize.height, Units.iconSizes.medium) + + implicitWidth: image.source != "" ? Units.iconSizes.smallMedium : 0 + implicitHeight: image.source != "" ? Units.iconSizes.smallMedium : 0 Image { id: image anchors.fill: parent source: root.source != "" ? (root.source.indexOf(".") === -1 ? "icons/" + root.source + ".svg" : root.source) : root.source + sourceSize.width: root.width + sourceSize.height: root.height } GammaAdjust { anchors.fill: image diff --git a/qt-mobile/qml/mobilecomponents/Page.qml b/qt-mobile/qml/mobilecomponents/Page.qml index 784ce8037..f55c24faa 100644 --- a/qt-mobile/qml/mobilecomponents/Page.qml +++ b/qt-mobile/qml/mobilecomponents/Page.qml @@ -57,7 +57,7 @@ Rectangle { Connections { target: flickable - property real oldContentY: flickable.contentY + property real oldContentY: (flickable == null) ? 0 : flickable.contentY onContentYChanged: { actionButton.transform[0].y = Math.min(actionButton.height, Math.max(0, actionButton.transform[0].y + (flickable.contentY - oldContentY)));