From 63300072c4e30e5d805d8539fa20cafb38a79c5e Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 21 Apr 2015 10:08:37 +0200 Subject: [PATCH] optional dialer in the call page --- dialer/contents/ui/Call/CallPage.qml | 52 ++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/dialer/contents/ui/Call/CallPage.qml b/dialer/contents/ui/Call/CallPage.qml index 42743d9e..e8ad0627 100644 --- a/dialer/contents/ui/Call/CallPage.qml +++ b/dialer/contents/ui/Call/CallPage.qml @@ -24,6 +24,8 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.nemomobile.voicecall 1.0 +import "../Dialpad" + Item { id: callPage @@ -53,7 +55,45 @@ Item { margins: 20 } - Avatar {} + Flickable { + id: topFlickable + Layout.fillWidth: true + Layout.fillHeight: true + Layout.minimumHeight: parent.height/2 + + contentWidth: topContents.width; + contentHeight: topContents.height + Row { + id: topContents + Avatar { + width: topFlickable.width + height: topFlickable.height + } + Dialpad { + width: topFlickable.width + height: topFlickable.height + } + } + + onMovingChanged: { + var checked = contentX > topFlickable.width/2; + + if (checked) { + topSlideAnim.to = topFlickable.width; + } else { + topSlideAnim.to = 0; + } + dialerButton.checked = checked; + topSlideAnim.running = true; + } + PropertyAnimation { + id: topSlideAnim + target: topFlickable + properties: "contentX" + duration: units.longDuration + easing.type: Easing.InOutQuad + } + } PlasmaComponents.Label { Layout.fillWidth: true @@ -98,8 +138,14 @@ Item { id: dialerButton flat: false iconSource: "input-keyboard" - onClicked: { - print("show dialer") + checkable: true + onCheckedChanged: { + if (checked) { + topSlideAnim.to = topFlickable.width; + } else { + topSlideAnim.to = 0; + } + topSlideAnim.running = true; } } }