Merge lp:~mzanetti/telegram-app/listitem into lp:telegram-app

Proposed by Michael Zanetti
Status: Merged
Approved by: MichaƂ Karnicki
Approved revision: 160
Merged at revision: 157
Proposed branch: lp:~mzanetti/telegram-app/listitem
Merge into: lp:telegram-app
Diff against target: 858 lines (+41/-683)
9 files modified
telegram/app/qml/AccountMessageList.qml (+36/-34)
telegram/app/qml/InstallStickerDialog.qml (+2/-2)
telegram/app/qml/components/AccountPanelItem.qml (+0/-2)
telegram/app/qml/components/MessagesListItem.qml (+3/-5)
telegram/app/qml/components/listitems/ImageWithFallback.qml (+0/-46)
telegram/app/qml/components/listitems/ListItemWithActions.qml (+0/-515)
telegram/app/qml/components/listitems/ListItemWithActionsCheckBox.qml (+0/-25)
telegram/app/qml/components/listitems/ProgressionVisual.qml (+0/-52)
telegram/app/telegram.qrc (+0/-2)
To merge this branch: bzr merge lp:~mzanetti/telegram-app/listitem
Reviewer Review Type Date Requested Status
Michael Zanetti Abstain
Review via email: mp+287545@code.launchpad.net

Commit message

update MessageListItem to uitk ListItem

This replaces the last occurance of the custom ListItemWithAction
so that one can be dropped. This seems to help a little with
scrolling performance and also fixes some listview contentY placement
issues.

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

just found an issue... clicking images is broken

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> just found an issue... clicking images is broken

fixed

review: Abstain
Revision history for this message
Andrea Bernabei (faenil) wrote :

lgtm

lp:~mzanetti/telegram-app/listitem updated
160. By Michael Zanetti

improve hiding of the divider

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'telegram/app/qml/AccountMessageList.qml'
--- telegram/app/qml/AccountMessageList.qml 2016-02-29 10:22:26 +0000
+++ telegram/app/qml/AccountMessageList.qml 2016-03-01 11:29:27 +0000
@@ -228,48 +228,51 @@
228 visibleNames: isChat228 visibleNames: isChat
229 opacity: filterId == user.id || filterId == -1 ? 1 : 0.1229 opacity: filterId == user.id || filterId == -1 ? 1 : 0.1
230230
231 leftSideActions: [231 leadingActions: ListItemActions {
232 Action {232 actions: [
233 iconName: "delete"233 Action {
234 text: i18n.tr("Delete")234 iconName: "delete"
235 onTriggered: telegram.deleteMessages([item.id])235 text: i18n.tr("Delete")
236 }236 onTriggered: telegram.deleteMessages([item.id])
237 ]237 }
238 ]
239 }
238240
239 rightSideActions: [241 trailingActions: ListItemActions {
240 // TODO resend action242 // TODO resend action
241 Action {243 actions: [
242 iconName: "edit-copy"244 Action {
243 text: i18n.tr("Copy")245 iconName: "edit-copy"
244 visible: !message_item.hasMedia246 text: i18n.tr("Copy")
245 onTriggered: Clipboard.push(item.message)247 visible: !message_item.hasMedia
246 },248 onTriggered: Clipboard.push(item.message)
247 Action {249 },
248 iconName: "info"250 Action {
249 text: i18n.tr("Sticker Pack info")251 iconName: "info"
250 visible: message_item.isSticker && telegramObject.documentStickerId(message_item.media.document) !== 0252 text: i18n.tr("Sticker Pack info")
251 onTriggered: {253 visible: message_item.isSticker && telegramObject.documentStickerId(message_item.media.document) !== 0
252 sticker_installer.doc = message_item.media.document254 onTriggered: {
253 telegramObject.getStickerSet(sticker_installer.doc)255 sticker_installer.doc = message_item.media.document
256 telegramObject.getStickerSet(sticker_installer.doc)
257 }
258 },
259 Action {
260 iconName: "next"
261 text: i18n.tr("Forward")
262 visible: enchat == telegramObject.nullEncryptedChat
263 onTriggered: forwardMessages([message.id])
254 }264 }
255 },265 ]
256 Action {266 }
257 iconName: "next"
258 text: i18n.tr("Forward")
259 visible: enchat == telegramObject.nullEncryptedChat
260 onTriggered: forwardMessages([message.id])
261 }
262
263 ]
264267
265 selected: mlist.isSelected(message_item)268 selected: mlist.isSelected(message_item)
266 selectionMode: mlist.isInSelectionMode269 selectMode: mlist.isInSelectionMode
267270
268 onDialogRequest: acc_msg_list.dialogRequest(dialog)271 onDialogRequest: acc_msg_list.dialogRequest(dialog)
269 onTagSearchRequest: acc_msg_list.tagSearchRequest(tag)272 onTagSearchRequest: acc_msg_list.tagSearchRequest(tag)
270 onMessageFocusRequest: focusOnMessage(msgId)273 onMessageFocusRequest: focusOnMessage(msgId)
271274
272 onItemPressAndHold: {275 onPressAndHold: {
273 mlist.clearSelection();276 mlist.clearSelection();
274 mlist.startSelection();277 mlist.startSelection();
275 if (mlist.isInSelectionMode) {278 if (mlist.isInSelectionMode) {
@@ -277,7 +280,7 @@
277 }280 }
278 }281 }
279282
280 onItemClicked: {283 onClicked: {
281 console.log("on item clicked");284 console.log("on item clicked");
282 if (mlist.isInSelectionMode) {285 if (mlist.isInSelectionMode) {
283 if (selected) {286 if (selected) {
@@ -287,7 +290,6 @@
287 }290 }
288 }291 }
289292
290 mouse.accepted = true;
291 message_item.click();293 message_item.click();
292 }294 }
293295
294296
=== modified file 'telegram/app/qml/InstallStickerDialog.qml'
--- telegram/app/qml/InstallStickerDialog.qml 2016-02-29 10:32:35 +0000
+++ telegram/app/qml/InstallStickerDialog.qml 2016-03-01 11:29:27 +0000
@@ -65,7 +65,7 @@
6565
66 UC.Button {66 UC.Button {
67 text: i18n.tr("Install")67 text: i18n.tr("Install")
68 color: UT.UbuntuColors.blue68 color: UC.UbuntuColors.blue
69 onClicked: {69 onClicked: {
70 telegram.installStickerSet(root.stickerSet)70 telegram.installStickerSet(root.stickerSet)
71 PopupUtils.close(root)71 PopupUtils.close(root)
@@ -73,7 +73,7 @@
73 }73 }
74 UC.Button {74 UC.Button {
75 text: i18n.tr("Close")75 text: i18n.tr("Close")
76 color: UT.UbuntuColors.orange76 color: UC.UbuntuColors.orange
77 onClicked: PopupUtils.close(root)77 onClicked: PopupUtils.close(root)
78 }78 }
79}79}
8080
=== modified file 'telegram/app/qml/components/AccountPanelItem.qml'
--- telegram/app/qml/components/AccountPanelItem.qml 2015-10-02 11:59:49 +0000
+++ telegram/app/qml/components/AccountPanelItem.qml 2016-03-01 11:29:27 +0000
@@ -17,8 +17,6 @@
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
1919
20import "./listitems"
21
22ListItem {20ListItem {
23 id: item21 id: item
2422
2523
=== modified file 'telegram/app/qml/components/MessagesListItem.qml'
--- telegram/app/qml/components/MessagesListItem.qml 2016-02-29 10:22:26 +0000
+++ telegram/app/qml/components/MessagesListItem.qml 2016-03-01 11:29:27 +0000
@@ -6,19 +6,16 @@
66
7import "qrc:/qml"7import "qrc:/qml"
8import "qrc:/qml/components"8import "qrc:/qml/components"
9import "qrc:/qml/components/listitems"
10import "qrc:/qml/js/colors.js" as Colors9import "qrc:/qml/js/colors.js" as Colors
11import "../js/avatar.js" as Avatar10import "../js/avatar.js" as Avatar
12import "../js/ba-linkify.js" as BaLinkify11import "../js/ba-linkify.js" as BaLinkify
1312
14ListItemWithActions {13ListItem {
15 id: message_item14 id: message_item
16 width: 10015 width: 100
17 height: (logicalHeight > minimumHeight) ? logicalHeight : minimumHeight16 height: (logicalHeight > minimumHeight) ? logicalHeight : minimumHeight
18 clip: true17 clip: true
1918 divider.visible: false
20 color: Qt.rgba(0, 0, 0, 0)
21 selectedColor: Qt.rgba(0, 0, 0, 0.2)
2219
23 property real messageFrameX: back_rect.x20 property real messageFrameX: back_rect.x
24 property real messageFrameY: back_rect.y21 property real messageFrameY: back_rect.y
@@ -95,6 +92,7 @@
95 anchors {92 anchors {
96 top: frame_row.top93 top: frame_row.top
97 leftMargin: units.dp(4)94 leftMargin: units.dp(4)
95 topMargin: units.gu(.5)
98 }96 }
99 height: units.gu(5)97 height: units.gu(5)
100 visible: message_item.visibleNames && !message.out98 visible: message_item.visibleNames && !message.out
10199
=== removed directory 'telegram/app/qml/components/listitems'
=== removed file 'telegram/app/qml/components/listitems/ImageWithFallback.qml'
--- telegram/app/qml/components/listitems/ImageWithFallback.qml 2015-09-22 09:57:07 +0000
+++ telegram/app/qml/components/listitems/ImageWithFallback.qml 1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18
19Image {
20 id: image
21
22 property url fallbackSource
23 property bool fallbackRequired: false
24
25 function isSourceDefined(sourceUrl) {
26 return sourceUrl != "" && sourceUrl != undefined
27 }
28
29 function tryLoadingFallbackSource() {
30 if (isSourceDefined(fallbackSource)) {
31 source = fallbackSource
32 }
33 }
34
35 function checkStatus() {
36 if (!isSourceDefined(source) || (status == Image.Error && source != fallbackSource)) {
37 fallbackRequired = true
38 tryLoadingFallbackSource()
39 }
40 }
41
42 onSourceChanged: fallbackRequired = false
43 onFallbackSourceChanged: if (fallbackRequired) tryLoadingFallbackSource()
44 onStatusChanged: checkStatus()
45 Component.onCompleted: checkStatus()
46}
470
=== removed file 'telegram/app/qml/components/listitems/ListItemWithActions.qml'
--- telegram/app/qml/components/listitems/ListItemWithActions.qml 2015-09-25 14:00:07 +0000
+++ telegram/app/qml/components/listitems/ListItemWithActions.qml 1970-01-01 00:00:00 +0000
@@ -1,515 +0,0 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import QtFeedback 5.0
19import Ubuntu.Components 1.1
20import Ubuntu.Components.ListItems 1.0 as ListItem
21
22Item {
23 id: root
24
25 property list<Action> leftSideActions
26 property list<Action> rightSideActions
27 property double defaultHeight: units.gu(8)
28 property bool locked: false
29 property Action activeAction: null
30 property var activeItem: null
31 property bool triggerActionOnMouseRelease: false
32 property color color: Theme.palette.normal.background
33 property color selectedColor: "#E6E6E6"
34 property bool selected: false
35 property bool selectionMode: false
36 property alias pressed: mouseArea.pressed
37 property alias showDivider: divider.visible
38 property alias internalAnchors: mainContents.anchors
39 default property alias contents: mainContents.children
40
41 readonly property double actionWidth: units.gu(4)
42 readonly property double actionThreshold: actionWidth * 0.4
43 readonly property double threshold: actionWidth * 0.8
44 readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
45 readonly property alias swipping: mainItemMoving.running
46 readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
47
48 /* internal */
49 property var _visibleLeftSideActions: filterVisibleActions(leftSideActions)
50 property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
51
52 /* Remember to mouse.accepted = true when managing this component */
53 signal itemClicked(var mouse)
54 signal itemPressAndHold(var mouse)
55
56 function returnToBoundsRTL(direction) {
57 var actionFullWidth = actionWidth + units.gu(2)
58
59 // go back to normal state if swipping reverse
60 if (direction === "LTR") {
61 updatePosition(0)
62 return
63 } else if (!triggerActionOnMouseRelease) {
64 updatePosition(-rightActionsView.width + units.gu(2))
65 return
66 }
67
68 var xOffset = Math.abs(main.x)
69 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
70 var newX = 0
71 if (index === _visibleRightSideActions.length) {
72 newX = -(rightActionsView.width - units.gu(2))
73 } else if (index >= 1) {
74 newX = -(actionFullWidth * index)
75 }
76 updatePosition(newX)
77 }
78
79 function returnToBoundsLTR(direction) {
80 var actionFullWidth = actionWidth + units.gu(2)
81
82 // go back to normal state if swipping reverse
83 if (direction === "RTL") {
84 updatePosition(0)
85 return
86 } else if (!triggerActionOnMouseRelease) {
87 updatePosition(leftActionView.width - units.gu(2))
88 return
89 }
90
91 var xOffset = Math.abs(main.x)
92 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleLeftSideActions.length)
93 var newX = 0
94 if (index === _visibleLeftSideActions.length) {
95 newX = leftActionView.width - units.gu(2)
96 } else if (index >= 1) {
97 newX = actionFullWidth * index
98 }
99 updatePosition(newX)
100 }
101
102 function returnToBounds(direction) {
103 if (main.x < 0) {
104 returnToBoundsRTL(direction)
105 } else if (main.x > 0) {
106 returnToBoundsLTR(direction)
107 } else {
108 updatePosition(0)
109 }
110 }
111
112 function contains(item, point, marginX) {
113 var itemStartX = item.x - marginX
114 var itemEndX = item.x + item.width + marginX
115 return (point.x >= itemStartX) && (point.x <= itemEndX) &&
116 (point.y >= item.y) && (point.y <= (item.y + item.height));
117 }
118
119 function getActionAt(point) {
120 if (contains(leftActionView, point, 0)) {
121 var newPoint = root.mapToItem(leftActionView, point.x, point.y)
122 for (var i = 0; i < leftActionsRepeater.count; i++) {
123 var child = leftActionsRepeater.itemAt(i)
124 if (contains(child, newPoint, units.gu(3))) {
125 return i
126 }
127 }
128 } else if (contains(rightActionsView, point, 0)) {
129 var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
130 for (var i = 0; i < rightActionsRepeater.count; i++) {
131 var child = rightActionsRepeater.itemAt(i)
132 if (contains(child, newPoint, units.gu(3))) {
133 return i
134 }
135 }
136 }
137 return -1
138 }
139
140 function updateActiveAction() {
141 if (triggerActionOnMouseRelease &&
142 (main.x <= -(root.actionWidth + units.gu(2))) &&
143 (main.x > -(rightActionsView.width - units.gu(2)))) {
144 var actionFullWidth = actionWidth + units.gu(2)
145 var xOffset = Math.abs(main.x)
146 var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
147 index = index - 1
148 if (index > -1) {
149 root.activeItem = rightActionsRepeater.itemAt(index)
150 root.activeAction = root._visibleRightSideActions[index]
151 }
152 } else {
153 root.activeAction = null
154 }
155 }
156
157 function resetSwipe() {
158 main.x = 0
159 }
160
161 function filterVisibleActions(actions) {
162 var visibleActions = []
163 for(var i = 0; i < actions.length; i++) {
164 var action = actions[i]
165 if (action.visible) {
166 visibleActions.push(action)
167 }
168 }
169 return visibleActions
170 }
171
172 function updatePosition(pos) {
173 if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
174 mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
175 } else {
176 mouseArea.state = ""
177 }
178 main.x = pos
179 }
180
181 states: [
182 State {
183 name: "select"
184 when: selectionMode || selected
185 PropertyChanges {
186 target: selectionIcon
187 source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
188 anchors.leftMargin: units.gu(2)
189 }
190 PropertyChanges {
191 target: root
192 locked: true
193 }
194 PropertyChanges {
195 target: main
196 x: 0
197 }
198 }
199 ]
200
201 height: defaultHeight
202 clip: height !== defaultHeight
203 HapticsEffect {
204 id: clickEffect
205 attackIntensity: 0.0
206 attackTime: 50
207 intensity: 1.0
208 duration: 10
209 fadeTime: 50
210 fadeIntensity: 0.0
211 }
212
213 Rectangle {
214 id: leftActionView
215
216 anchors {
217 top: parent.top
218 bottom: parent.bottom
219 right: main.left
220 }
221 visible: _visibleLeftSideActions.length > 0
222 width: leftActionsRepeater.count > 0 ? leftActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(3) : 0
223 color: "#eef32c36" // UbuntuColors.red with alpha
224
225 Row {
226 anchors{
227 top: parent.top
228 bottom: parent.bottom
229 right: parent.right
230 rightMargin: units.gu(1)
231 }
232 spacing: 0
233 Repeater {
234 id: leftActionsRepeater
235
236 model: _showActions ? _visibleLeftSideActions : []
237 Item {
238 property alias image: img
239
240 height: leftActionView.height
241 width: root.actionWidth + units.gu(2)
242
243 Icon {
244 id: img
245
246 anchors.centerIn: parent
247 width: units.gu(3)
248 height: units.gu(3)
249 name: modelData.iconName
250 color: "white"
251 }
252 }
253 }
254 }
255 }
256
257 Rectangle {
258 id: rightActionsView
259
260 anchors {
261 top: main.top
262 left: main.right
263 bottom: main.bottom
264 }
265 visible: _visibleRightSideActions.length > 0
266 width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(3) : 0
267 color: "white"
268 Row {
269 anchors{
270 top: parent.top
271 bottom: parent.bottom
272 left: parent.left
273 leftMargin: units.gu(1)
274 }
275 spacing: 0
276 Repeater {
277 id: rightActionsRepeater
278
279 model: _showActions ? _visibleRightSideActions : []
280 Item {
281 property alias image: img
282
283 height: rightActionsView.height
284 width: root.actionWidth + units.gu(2)
285
286 Icon {
287 id: img
288
289 anchors.centerIn: parent
290 width: units.gu(3)
291 height: units.gu(3)
292 name: modelData.iconName
293 color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey
294 }
295 }
296 }
297 }
298 }
299
300 Rectangle {
301 id: main
302 objectName: "mainItem"
303
304 anchors {
305 top: parent.top
306 bottom: parent.bottom
307 }
308
309 width: parent.width
310 color: root.selected ? root.selectedColor : root.color
311
312 Loader {
313 id: selectionIcon
314
315 anchors {
316 left: main.left
317 verticalCenter: main.verticalCenter
318 }
319 width: (status === Loader.Ready) ? item.implicitWidth : 0
320 visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
321 Behavior on width {
322 NumberAnimation {
323 duration: UbuntuAnimation.SnapDuration
324 }
325 }
326 }
327
328 Item {
329 id: mainContents
330
331 anchors {
332 left: selectionIcon.right
333 top: parent.top
334 topMargin: units.gu(1)
335 right: parent.right
336 bottom: parent.bottom
337 bottomMargin: units.gu(1)
338 }
339 }
340
341 Behavior on x {
342 UbuntuNumberAnimation {
343 id: mainItemMoving
344
345 easing.type: Easing.OutElastic
346 duration: UbuntuAnimation.SlowDuration
347 }
348 }
349
350 Behavior on color {
351 ColorAnimation {}
352 }
353 }
354
355 SequentialAnimation {
356 id: triggerAction
357
358 property var currentItem: root.activeItem ? root.activeItem.image : null
359
360 running: false
361 ParallelAnimation {
362 UbuntuNumberAnimation {
363 target: triggerAction.currentItem
364 property: "opacity"
365 from: 1.0
366 to: 0.0
367 duration: UbuntuAnimation.SlowDuration
368 easing { type: Easing.InOutBack; }
369 }
370 UbuntuNumberAnimation {
371 target: triggerAction.currentItem
372 properties: "width, height"
373 from: units.gu(3)
374 to: root.actionWidth
375 duration: UbuntuAnimation.SlowDuration
376 easing { type: Easing.InOutBack; }
377 }
378 }
379 PropertyAction {
380 target: triggerAction.currentItem
381 properties: "width, height"
382 value: units.gu(3)
383 }
384 PropertyAction {
385 target: triggerAction.currentItem
386 properties: "opacity"
387 value: 1.0
388 }
389 ScriptAction {
390 script: {
391 root.activeAction.triggered(root)
392 mouseArea.state = ""
393 }
394 }
395 PauseAnimation {
396 duration: 500
397 }
398 UbuntuNumberAnimation {
399 target: main
400 property: "x"
401 to: 0
402 }
403 }
404
405 MouseArea {
406 id: mouseArea
407
408 propagateComposedEvents: true
409 property bool locked: root.locked || ((root._visibleLeftSideActions === null) && (root._visibleRightSideActions.count === 0))
410 property bool manual: false
411 property string direction: "None"
412 property real lastX: -1
413
414 anchors.fill: parent
415 z: -100
416
417 drag {
418 target: locked ? null : main
419 axis: Drag.XAxis
420 minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
421 maximumX: leftActionView.visible ? leftActionView.width : 0
422 threshold: root.threshold
423 }
424
425 states: [
426 State {
427 name: "LeftToRight"
428 PropertyChanges {
429 target: mouseArea
430 drag.maximumX: 0
431 }
432 },
433 State {
434 name: "RightToLeft"
435 PropertyChanges {
436 target: mouseArea
437 drag.minimumX: 0
438 }
439 }
440 ]
441
442 onMouseXChanged: {
443 var offset = (lastX - mouseX)
444 if (Math.abs(offset) <= root.threshold) {
445 return
446 }
447 lastX = mouseX
448 direction = offset > 0 ? "RTL" : "LTR";
449 }
450
451 onPressed: {
452 lastX = mouse.x
453 }
454
455 onReleased: {
456 if (root.triggerActionOnMouseRelease && root.activeAction) {
457 triggerAction.start()
458 } else {
459 root.returnToBounds(direction)
460 root.activeAction = null
461 }
462 lastX = -1
463 direction = "None"
464 }
465
466 onClicked: {
467 mouse.accepted = false
468 clickEffect.start()
469 if (main.x === 0) {
470 root.itemClicked(mouse)
471 } else if (main.x > 0) {
472 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
473 if (actionIndex !== -1) {
474 root.activeItem = leftActionsRepeater.itemAt(actionIndex)
475 root.activeAction = root._visibleLeftSideActions[actionIndex]
476 triggerAction.start()
477 return
478 }
479 } else {
480 var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
481 if (actionIndex !== -1) {
482 root.activeItem = rightActionsRepeater.itemAt(actionIndex)
483 root.activeAction = root._visibleRightSideActions[actionIndex]
484 triggerAction.start()
485 return
486 }
487 }
488 root.resetSwipe()
489 }
490
491 onPositionChanged: {
492 if (mouseArea.pressed) {
493 updateActiveAction()
494 }
495 }
496
497 onPressAndHold: {
498 if (main.x === 0) {
499 root.itemPressAndHold(mouse)
500 }
501 }
502 }
503
504 ListItem.ThinDivider {
505 id: divider
506 visible: false
507 width: parent.width + units.gu(4)
508 anchors {
509 left: parent.left
510 right: parent.right
511 bottom: parent.bottom
512 bottomMargin: units.gu(-0.1)
513 }
514 }
515}
5160
=== removed file 'telegram/app/qml/components/listitems/ListItemWithActionsCheckBox.qml'
--- telegram/app/qml/components/listitems/ListItemWithActionsCheckBox.qml 2015-09-22 09:57:07 +0000
+++ telegram/app/qml/components/listitems/ListItemWithActionsCheckBox.qml 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2012-2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.2
18import Ubuntu.Components 1.1
19
20CheckBox {
21 checked: root.selected
22 width: implicitWidth
23 // disable item mouse area to avoid conflicts with parent mouse area
24 __mouseArea.enabled: false
25}
260
=== removed file 'telegram/app/qml/components/listitems/ProgressionVisual.qml'
--- telegram/app/qml/components/listitems/ProgressionVisual.qml 2015-09-22 09:57:07 +0000
+++ telegram/app/qml/components/listitems/ProgressionVisual.qml 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18
19// Internal helper class for the visuals of
20// the progression symbol.
21Item {
22 id: progressionVisual
23
24 width: progressIcon.width + (showSplit ? splitMargin + progressionDivider.width : 0)
25
26 property bool showSplit: false
27 property real splitMargin
28
29 Image {
30 id: progressIcon
31 source: "artwork/ListItemProgressionArrow.png"
32 anchors {
33 verticalCenter: parent.verticalCenter
34 right: parent.right
35 }
36
37 opacity: enabled ? 1.0 : 0.5
38 }
39
40 Image {
41 id: progressionDivider
42 visible: progressionVisual.showSplit
43 anchors {
44 top: parent.top
45 bottom: parent.bottom
46 right: progressIcon.left
47 rightMargin: splitMargin
48 }
49 source: "artwork/ListItemDividerVertical.png"
50 opacity: enabled ? 1.0 : 0.5
51 }
52}
530
=== removed directory 'telegram/app/qml/components/listitems/artwork'
=== removed file 'telegram/app/qml/components/listitems/artwork/ListItemDivider24px@8.png'
54Binary files telegram/app/qml/components/listitems/artwork/ListItemDivider24px@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDivider24px@8.png 1970-01-01 00:00:00 +0000 differ1Binary files telegram/app/qml/components/listitems/artwork/ListItemDivider24px@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDivider24px@8.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'telegram/app/qml/components/listitems/artwork/ListItemDivider6px@8.png'
55Binary files telegram/app/qml/components/listitems/artwork/ListItemDivider6px@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDivider6px@8.png 1970-01-01 00:00:00 +0000 differ2Binary files telegram/app/qml/components/listitems/artwork/ListItemDivider6px@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDivider6px@8.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'telegram/app/qml/components/listitems/artwork/ListItemDividerHorizontal@18.png'
56Binary files telegram/app/qml/components/listitems/artwork/ListItemDividerHorizontal@18.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDividerHorizontal@18.png 1970-01-01 00:00:00 +0000 differ3Binary files telegram/app/qml/components/listitems/artwork/ListItemDividerHorizontal@18.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDividerHorizontal@18.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'telegram/app/qml/components/listitems/artwork/ListItemDividerVertical@18.png'
57Binary files telegram/app/qml/components/listitems/artwork/ListItemDividerVertical@18.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDividerVertical@18.png 1970-01-01 00:00:00 +0000 differ4Binary files telegram/app/qml/components/listitems/artwork/ListItemDividerVertical@18.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemDividerVertical@18.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'telegram/app/qml/components/listitems/artwork/ListItemProgressionArrow@8.png'
58Binary files telegram/app/qml/components/listitems/artwork/ListItemProgressionArrow@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemProgressionArrow@8.png 1970-01-01 00:00:00 +0000 differ5Binary files telegram/app/qml/components/listitems/artwork/ListItemProgressionArrow@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/ListItemProgressionArrow@8.png 1970-01-01 00:00:00 +0000 differ
=== removed file 'telegram/app/qml/components/listitems/artwork/delete@8.png'
59Binary files telegram/app/qml/components/listitems/artwork/delete@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/delete@8.png 1970-01-01 00:00:00 +0000 differ6Binary files telegram/app/qml/components/listitems/artwork/delete@8.png 2015-09-22 09:57:07 +0000 and telegram/app/qml/components/listitems/artwork/delete@8.png 1970-01-01 00:00:00 +0000 differ
=== modified file 'telegram/app/telegram.qrc'
--- telegram/app/telegram.qrc 2016-02-29 10:22:26 +0000
+++ telegram/app/telegram.qrc 2016-03-01 11:29:27 +0000
@@ -62,8 +62,6 @@
62 <file>qml/components/TelegramContactsListItem.qml</file>62 <file>qml/components/TelegramContactsListItem.qml</file>
63 <file>qml/components/TelegramHeader.qml</file>63 <file>qml/components/TelegramHeader.qml</file>
64 <file>qml/components/TelegramPage.qml</file>64 <file>qml/components/TelegramPage.qml</file>
65 <file>qml/components/listitems/ListItemWithActions.qml</file>
66 <file>qml/components/listitems/ListItemWithActionsCheckBox.qml</file>
67 <file>qml/js/avatar.js</file>65 <file>qml/js/avatar.js</file>
68 <file>qml/js/ba-linkify.js</file>66 <file>qml/js/ba-linkify.js</file>
69 <file>qml/js/colors.js</file>67 <file>qml/js/colors.js</file>

Subscribers

People subscribed via source and target branches

to status/vote changes: