summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/mobilecomponents/private/ActionButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile/qml/mobilecomponents/private/ActionButton.qml')
-rw-r--r--qt-mobile/qml/mobilecomponents/private/ActionButton.qml12
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));
+ }
}
}