Merge lp:~rpadovani/ubuntu-weather-app/1198541 into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Riccardo Padovani
Status: Merged
Approved by: Martin Borho
Approved revision: 65
Merged at revision: 66
Proposed branch: lp:~rpadovani/ubuntu-weather-app/1198541
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 72 lines (+54/-3)
2 files modified
components/LocationManagerPage.qml (+3/-3)
components/SwipeDelete.qml (+51/-0)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-weather-app/1198541
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Martin Borho Approve
Review via email: mp+174955@code.launchpad.net

Commit message

Added text delete when swiping a location, based on work of Nekhelesh Ramananthan in clock app

Description of the change

Added text delete when swiping a location, based on work of Nekhelesh Ramananthan in clock app

To post a comment you must log in.
Revision history for this message
Martin Borho (martin-borho) wrote :

Fein, looks good!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/LocationManagerPage.qml'
2--- components/LocationManagerPage.qml 2013-07-03 19:39:29 +0000
3+++ components/LocationManagerPage.qml 2013-07-16 09:44:36 +0000
4@@ -165,9 +165,9 @@
5 storage.clearLocation(location.dbId);
6 locationModel.remove(index)
7 }
8- backgroundIndicator: Rectangle {
9- anchors.fill: parent
10- color: "gray"
11+ backgroundIndicator: SwipeDelete {
12+ id: swipeDelete
13+ state: swipingState
14 }
15 }
16 footer: ListItem.Standard {
17
18=== added file 'components/SwipeDelete.qml'
19--- components/SwipeDelete.qml 1970-01-01 00:00:00 +0000
20+++ components/SwipeDelete.qml 2013-07-16 09:44:36 +0000
21@@ -0,0 +1,51 @@
22+/*
23+ * Copyright (C) 2013 Canonical Ltd
24+ *
25+ * This program is free software: you can redistribute it and/or modify
26+ * it under the terms of the GNU General Public License version 3 as
27+ * published by the Free Software Foundation.
28+ *
29+ * This program is distributed in the hope that it will be useful,
30+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
31+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32+ * GNU General Public License for more details.
33+ *
34+ * You should have received a copy of the GNU General Public License
35+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
36+ *
37+ * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com>
38+ */
39+
40+import QtQuick 2.0
41+import Ubuntu.Components 0.1
42+
43+Rectangle {
44+ id: swipeBackgroundItem
45+
46+ anchors.fill: parent
47+ color: UbuntuColors.orange
48+
49+ Label {
50+ id: swipeBackgroundText
51+
52+ property int slidingMargin: units.gu(3)
53+
54+ anchors.fill: parent
55+ verticalAlignment: Text.AlignVCenter
56+ color: "#FFFFFF"
57+ }
58+
59+ states: [
60+ State {
61+ name: "SwipingRight"
62+ PropertyChanges { target: swipeBackgroundText; anchors.rightMargin: swipeBackgroundText.slidingMargin
63+ anchors.leftMargin: 0; horizontalAlignment: Text.AlignRight; text: i18n.tr("Delete") }
64+ },
65+
66+ State {
67+ name: "SwipingLeft"
68+ PropertyChanges { target: swipeBackgroundText; anchors.rightMargin: 0; anchors.leftMargin: swipeBackgroundText.slidingMargin
69+ horizontalAlignment: Text.AlignLeft; text: i18n.tr("Delete") }
70+ }
71+ ]
72+}

Subscribers

People subscribed via source and target branches