From 5e5c9830a48e8f9c0a376863b4fa17c7f5056af3 Mon Sep 17 00:00:00 2001 From: Sebastian Kügler Date: Sun, 29 Nov 2015 18:56:21 +0100 Subject: Sync with upstream mobilecomponents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This updates to the state of bf7914b67c45e Signed-off-by: Sebastian Kügler --- qt-mobile/qml/mobilecomponents/private/ActionButton.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'qt-mobile/qml/mobilecomponents/private/ActionButton.qml') diff --git a/qt-mobile/qml/mobilecomponents/private/ActionButton.qml b/qt-mobile/qml/mobilecomponents/private/ActionButton.qml index 5bf6ab086..bfc8c5875 100644 --- a/qt-mobile/qml/mobilecomponents/private/ActionButton.qml +++ b/qt-mobile/qml/mobilecomponents/private/ActionButton.qml @@ -73,10 +73,18 @@ MouseArea { } } } + Connections { + target: button.parent + onWidthChanged: button.x = button.parent.width/2 - button.width/2 + } onXChanged: { if (button.pressed) { - globalDrawer.position = Math.min(1, Math.max(0, (x - button.parent.width/2 + button.width/2)/globalDrawer.contentItem.width)); - contextDrawer.position = Math.min(1, Math.max(0, (button.parent.width/2 - button.width/2 - x)/contextDrawer.contentItem.width)); + if (globalDrawer) { + globalDrawer.position = Math.min(1, Math.max(0, (x - button.parent.width/2 + button.width/2)/globalDrawer.contentItem.width)); + } + if (contextDrawer) { + contextDrawer.position = Math.min(1, Math.max(0, (button.parent.width/2 - button.width/2 - x)/contextDrawer.contentItem.width)); + } } } -- cgit v1.2.3-70-g09d2