@@ -24,6 +24,8 @@ Rectangle {
2424 id: callHint
2525
2626 readonly property bool active: callManager.hasCalls && ApplicationManager.focusedApplicationId !== "dialer-app"
27+ readonly property QtObject contactWatcher: _contactWatcher
28+ property int alternateLabelInterval: 4000
2729
2830 Component.onCompleted: {
2931 telepathyHelper.registerChannelObserver("unity8");
@@ -39,51 +41,147 @@ Rectangle {
3941 }
4042 }
4143
42− Column {
43− id: column
44+ Component {
45+ id: contactColumnRow
4446
45− anchors {
46− left: parent.left
47− leftMargin:units.gu(1)
48− right: time.left
49− }
50− y: 0
51− Behavior on y { StandardAnimation { duration: 400 } }
47+ Column {
48+ id: column
49+ objectName: "contactColumn"
5250
53− Label {
54− id: label1
5551 anchors {
5652 left: parent.left
5753 right: parent.right
5854 }
59− height: callHint.height
60− verticalAlignment: Text.AlignVCenter
61−
62− text: {
63− if (!d.activeCall) {
64− return "";
65− } else if (d.activeCall.isConference) {
66− return i18n.tr("Conference");
55+ height: childrenRect.height
56+
57+ Component.onCompleted: {
58+ if (index === 0) {
59+ labelPathView.column1 = column;
6760 } else {
68− return contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber;
61+ labelPathView.column2 = column;
62+ }
63+ }
64+
65+ Label {
66+ id: contactLabel
67+ objectName: "contactLabel"
68+
69+ anchors {
70+ left: parent.left
71+ right: parent.right
72+ }
73+ height: callHint.height
74+ verticalAlignment: Text.AlignVCenter
75+
76+ text: {
77+ if (!d.activeCall) {
78+ return "";
79+ } else if (d.activeCall.isConference) {
80+ return i18n.tr("Conference");
81+ } else {
82+ return contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber;
83+ }
84+ }
85+ }
86+
87+ Label {
88+ id: returnLabel
89+
90+ anchors {
91+ left: parent.left
92+ right: parent.right
6993 }
94+ height: callHint.height
95+ verticalAlignment: Text.AlignVCenter
96+ text: i18n.tr("Tap to return to call...");
7097 }
7198 }
99+ }
100+
101+ PathView {
102+ id: labelPathView
103+ objectName: "labelPathView"
104+
105+ anchors {
106+ top: parent.top
107+ left: parent.left
108+ leftMargin:units.gu(1)
109+ right: time.left
110+ }
111+ height: columnHeight > callHint.height ? callHint.height : columnHeight
72112
73− Label {
74− id: label2
75− anchors {
76− left: parent.left
77− right: parent.right
113+ property Column column1
114+ property Column column2
115+ property int columnHeight: column1 ? column1.height : 0
116+
117+ delegate: contactColumnRow
118+
119+ model: 2
120+ offset: 0
121+
122+ path: Path {
123+ startY: -labelPathView.columnHeight / 2
124+ PathLine {
125+ y: labelPathView.columnHeight * 1.5
126+ }
127+ }
128+
129+ property real actualOffset: 0
130+ property bool offsetGuard: false
131+ onActualOffsetChanged: {
132+ if (offsetGuard) { return; }
133+ offsetGuard = true;
134+
135+ offset = actualOffset;
136+ if (actualOffset === model) { actualOffset = 0.0; }
137+ offsetGuard = false;
138+ }
139+
140+ Behavior on offset {
141+ id: offsetBehaviour
142+ SmoothedAnimation {
143+ id: offsetAnimation
144+ // ensure we go faster than the label switch
145+ duration: alternateLabelInterval / 2
146+ velocity: 1.0
147+ easing.type: Easing.InOutQuad
78148 }
79− height: callHint.height
80− verticalAlignment: Text.AlignVCenter
81− text: i18n.tr("Tap to return to call...");
149+ }
150+ }
151+
152+ // Fade in text
153+ Rectangle {
154+ anchors.fill: labelPathView
155+ gradient: Gradient {
156+ GradientStop { position: 0.0; color: Qt.rgba(callHint.color.r, callHint.color.g, callHint.color.b, 1.0) }
157+ GradientStop { position: 0.25; color: Qt.rgba(callHint.color.r, callHint.color.g, callHint.color.b, 0.0) }
158+ GradientStop { position: 0.75; color: Qt.rgba(callHint.color.r, callHint.color.g, callHint.color.b, 0.0) }
159+ GradientStop { position: 1.0; color: Qt.rgba(callHint.color.r, callHint.color.g, callHint.color.b, 1.0) }
160+ }
161+ }
162+
163+ Timer {
164+ running: callHint.active
165+ interval: alternateLabelInterval
166+ repeat: true
167+
168+ onRunningChanged: {
169+ if (running) {
170+ offsetBehaviour.enabled = false;
171+ labelPathView.actualOffset = 0;
172+ offsetBehaviour.enabled = true;
173+ }
174+ }
175+
176+ onTriggered: {
177+ labelPathView.actualOffset = labelPathView.actualOffset + 0.5;
82178 }
83179 }
84180
85181 Label {
86182 id: time
183+ objectName: "timeLabel"
184+
87185 anchors {
88186 right: parent.right
89187 rightMargin:units.gu(1)
@@ -106,30 +204,11 @@ Rectangle {
106204 }
107205
108206 Telephony.ContactWatcher {
109− id: contactWatcher
207+ id: _contactWatcher
208+ objectName: "contactWatcher"
110209 phoneNumber: d.activeCall ? d.activeCall.phoneNumber : ""
111210 }
112211
113− Timer {
114− running: callHint.active
115− interval: 4000
116− repeat: true
117−
118− property int iteration: 0
119−
120− onRunningChanged: iteration = 0; // bit longer for the first one.
121−
122− onTriggered: {
123− // every 4 seconds.
124− if (iteration % 2 == 0) {
125− column.y = -label1.height;
126− } else {
127− column.y = 0;
128− }
129− iteration++;
130− }
131− }
132−
133212 QtObject {
134213 id: d
135214