Sync with upstream mobilecomponents

This updates to the state of bf7914b67c45e

Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
Sebastian Kügler 2015-11-29 18:56:21 +01:00
parent 6ffef818a8
commit 5e5c9830a4
4 changed files with 20 additions and 9 deletions

View file

@ -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));
}
}
}