@@ -24,6 +24,8 @@ Rectangle {
24 id: callHint
24 id: callHint
26 readonly property bool active: callManager.hasCalls && ApplicationManager.focusedApplicationId !== "dialer-app"
26 readonly property bool active: callManager.hasCalls && ApplicationManager.focusedApplicationId !== "dialer-app"
27+ readonly property QtObject contactWatcher: _contactWatcher
28+ property int alternateLabelInterval: 4000
28 Component.onCompleted: {
30 Component.onCompleted: {
29 telepathyHelper.registerChannelObserver("unity8");
31 telepathyHelper.registerChannelObserver("unity8");
@@ -39,51 +41,147 @@ Rectangle {
42− Column {
44+ Component {
43− id: column
45+ id: contactColumnRow
45− anchors {
47+ Column {
46− left: parent.left
48+ id: column
47− leftMargin:units.gu(1)
49+ objectName: "contactColumn"
51− Behavior on y { StandardAnimation { duration: 400 } }
56 left: parent.left
52 left: parent.left
57 right: parent.right
53 right: parent.right
59− height: callHint.height
55+ height: childrenRect.height
60− verticalAlignment: Text.AlignVCenter
56+
61−
57+ Component.onCompleted: {
62− text: {
58+ if (index === 0) {
63− if (!d.activeCall) {
59+ labelPathView.column1 = column;
65− } else if (d.activeCall.isConference) {
66− return i18n.tr("Conference");
61+ labelPathView.column2 = column;
67+ objectName: "contactLabel"
73+ height: callHint.height
74+ verticalAlignment: Text.AlignVCenter
79+ } else if (d.activeCall.isConference) {
80+ return i18n.tr("Conference");
68− return contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber;
82+ return contactWatcher.alias !== "" ? contactWatcher.alias : contactWatcher.phoneNumber;
94+ height: callHint.height
95+ verticalAlignment: Text.AlignVCenter
96+ text: i18n.tr("Tap to return to call...");
103+ objectName: "labelPathView"
108+ leftMargin:units.gu(1)
111+ height: columnHeight > callHint.height ? callHint.height : columnHeight
73− Label {
113+ property Column column1
74− id: label2
114+ property Column column2
75− anchors {
115+ property int columnHeight: column1 ? column1.height : 0
76− left: parent.left
116+
77− right: parent.right
117+ delegate: contactColumnRow
123+ startY: -labelPathView.columnHeight / 2
125+ y: labelPathView.columnHeight * 1.5
129+ property real actualOffset: 0
130+ property bool offsetGuard: false
131+ onActualOffsetChanged: {
132+ if (offsetGuard) { return; }
135+ offset = actualOffset;
136+ if (actualOffset === model) { actualOffset = 0.0; }
137+ offsetGuard = false;
140+ Behavior on offset {
144+ // ensure we go faster than the label switch
145+ duration: alternateLabelInterval / 2
147+ easing.type: Easing.InOutQuad
79− height: callHint.height
149+ }
80− verticalAlignment: Text.AlignVCenter
150+ }
81− text: i18n.tr("Tap to return to call...");
151+
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) }
164+ running: callHint.active
165+ interval: alternateLabelInterval
170+ offsetBehaviour.enabled = false;
171+ labelPathView.actualOffset = 0;
172+ offsetBehaviour.enabled = true;
177+ labelPathView.actualOffset = labelPathView.actualOffset + 0.5;
183+ objectName: "timeLabel"
87 anchors {
185 anchors {
88 right: parent.right
186 right: parent.right
89 rightMargin:units.gu(1)
187 rightMargin:units.gu(1)
@@ -106,30 +204,11 @@ Rectangle {
108 Telephony.ContactWatcher {
206 Telephony.ContactWatcher {
109− id: contactWatcher
208+ objectName: "contactWatcher"
110 phoneNumber: d.activeCall ? d.activeCall.phoneNumber : ""
209 phoneNumber: d.activeCall ? d.activeCall.phoneNumber : ""
114− running: callHint.active
118− property int iteration: 0
120− onRunningChanged: iteration = 0; // bit longer for the first one.
124− if (iteration % 2 == 0) {
125− column.y = -label1.height;
133 QtObject {
212 QtObject {