Merge lp:~nik90/ubuntu-clock-app/timer-swipe-delete into lp:ubuntu-clock-app/saucy

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 48
Merged at revision: 46
Proposed branch: lp:~nik90/ubuntu-clock-app/timer-swipe-delete
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 96 lines (+77/-2)
2 files modified
timer/BackgroundTimer.qml (+54/-0)
timer/TimerPage.qml (+23/-2)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/timer-swipe-delete
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Clock Developers Pending
Review via email: mp+161597@code.launchpad.net

Commit message

Add swipe left/right support to delete saved timer preset similar to the Alarms feature

Description of the change

This MP adds swipe right/left option to delete a saved timer preset similar to the feature present in the Alarms.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
48. By Nekhelesh Ramananthan

merge from master

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'timer/BackgroundTimer.qml'
2--- timer/BackgroundTimer.qml 1970-01-01 00:00:00 +0000
3+++ timer/BackgroundTimer.qml 2013-04-30 13:12:25 +0000
4@@ -0,0 +1,54 @@
5+/*
6+ * Copyright (C) 2013 Canonical Ltd
7+ *
8+ * This program is free software: you can redistribute it and/or modify
9+ * it under the terms of the GNU General Public License version 3 as
10+ * published by the Free Software Foundation.
11+ *
12+ * This program is distributed in the hope that it will be useful,
13+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+ * GNU General Public License for more details.
16+ *
17+ * You should have received a copy of the GNU General Public License
18+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
19+ *
20+ * Authored by: Nekhelesh Ramananthan <krnekhelesh@gmail.com>
21+ */
22+
23+import QtQuick 2.0
24+import Ubuntu.Components 0.1
25+import "../common/Constants.js" as Constants
26+
27+Rectangle {
28+ id: swipeBackgroundItem
29+
30+ anchors.fill: parent
31+ color: Constants.ubuntuOrange
32+
33+ Label {
34+ id: swipeBackgroundText
35+
36+ property int slidingMargin: units.gu(3)
37+
38+ anchors.fill: parent
39+ verticalAlignment: Text.AlignVCenter
40+ color: Constants.brightWhite
41+ fontSize: "medium"
42+ font.bold: true
43+ }
44+
45+ states: [
46+ State {
47+ name: "SwipingRight"
48+ PropertyChanges { target: swipeBackgroundText; anchors.rightMargin: swipeBackgroundText.slidingMargin
49+ anchors.leftMargin: 0; horizontalAlignment: Text.AlignRight; text: i18n.tr("Delete") }
50+ },
51+
52+ State {
53+ name: "SwipingLeft"
54+ PropertyChanges { target: swipeBackgroundText; anchors.rightMargin: 0; anchors.leftMargin: swipeBackgroundText.slidingMargin
55+ horizontalAlignment: Text.AlignLeft; text: i18n.tr("Delete") }
56+ }
57+ ]
58+}
59
60=== modified file 'timer/TimerPage.qml'
61--- timer/TimerPage.qml 2013-04-28 13:07:23 +0000
62+++ timer/TimerPage.qml 2013-04-30 13:12:25 +0000
63@@ -724,10 +724,31 @@
64
65 ListItem.Divider { }
66
67- delegate: ListItem.SingleValue {
68+ delegate: ListItem.Standard {
69 text: nametimer
70- value: TScript.getstringTimer(secondstimer)
71+
72+ Label {
73+ fontSize: "medium"
74+ text: TScript.getstringTimer(secondstimer)
75+ anchors { verticalCenter: parent.verticalCenter; right: parent.right; rightMargin: units.gu(2) }
76+ }
77+
78 selected: select
79+ removable: true
80+
81+ backgroundIndicator: BackgroundTimer {
82+ id: backgroundTimer
83+ state: swipingState
84+ }
85+
86+ onItemRemoved: if (backgroundTimer.state == "SwipingRight") {
87+ storageTimer.delTimerValue(text);
88+ TScript.populatePreset();
89+ } else {
90+ storageTimer.delTimerValue(text);
91+ TScript.populatePreset();
92+ }
93+
94 onClicked: {
95 if (!timerOn) {
96 buttonTimer.state = "START";

Subscribers

People subscribed via source and target branches