diff options
author | Sebastian Kügler <sebas@kde.org> | 2015-11-29 18:56:21 +0100 |
---|---|---|
committer | Sebastian Kügler <sebas@kde.org> | 2015-11-29 18:57:50 +0100 |
commit | 5e5c9830a48e8f9c0a376863b4fa17c7f5056af3 (patch) | |
tree | 2f2c8f89ce8c3cecad6b9f4279d94106b5cbe41d /qt-mobile/qml/mobilecomponents/private | |
parent | 6ffef818a8d34fdc8aef70c3515c2b91d8d297ac (diff) | |
download | subsurface-5e5c9830a48e8f9c0a376863b4fa17c7f5056af3.tar.gz |
Sync with upstream mobilecomponents
This updates to the state of bf7914b67c45e
Signed-off-by: Sebastian Kügler <sebas@kde.org>
Diffstat (limited to 'qt-mobile/qml/mobilecomponents/private')
-rw-r--r-- | qt-mobile/qml/mobilecomponents/private/ActionButton.qml | 12 |
1 files changed, 10 insertions, 2 deletions
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)); + } } } |