Merge lp:~nik90/podbird/2-add-button-feedback into lp:podbird

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Michael Sheldon
Approved revision: 47
Merged at revision: 37
Proposed branch: lp:~nik90/podbird/2-add-button-feedback
Merge into: lp:podbird
Prerequisite: lp:~nik90/podbird/1-add-theming-support
Diff against target: 276 lines (+100/-71)
5 files modified
app/ui/ActionButton.qml (+41/-0)
app/ui/EpisodesPage.qml (+29/-45)
app/ui/NowPlayingPage.qml (+3/-3)
app/ui/PlayerControls.qml (+25/-21)
po/com.mikeasoft.podbird.pot (+2/-2)
To merge this branch: bzr merge lp:~nik90/podbird/2-add-button-feedback
Reviewer Review Type Date Requested Status
Michael Sheldon Approve
Review via email: mp+252215@code.launchpad.net

Commit message

this MP converts all actions buttons to use AbstractButton which will then provide haptic feedback when pressed. I also added a light button background which is shown when the button is pressed to make it visually pleasing.

Description of the change

this MP converts all actions buttons to use AbstractButton which will then provide haptic feedback when pressed. I also added a light button background which is shown when the button is pressed to make it visually pleasing.

To post a comment you must log in.
43. By Nekhelesh Ramananthan

Fixed action icon left margin

44. By Nekhelesh Ramananthan

Merged prerequisite branch

45. By Nekhelesh Ramananthan

Merged prerequisite branch

46. By Nekhelesh Ramananthan

Merged prerequisite

47. By Nekhelesh Ramananthan

Merged prerequisite lp:~nik90/podbird/1-add-theming-support

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'app/ui/ActionButton.qml'
2--- app/ui/ActionButton.qml 1970-01-01 00:00:00 +0000
3+++ app/ui/ActionButton.qml 2015-03-27 15:31:54 +0000
4@@ -0,0 +1,41 @@
5+/*
6+ * Copyright 2015 Podbird Team
7+ *
8+ * This file is part of Podbird.
9+ *
10+ * Podbird is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * Podbird is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import QtQuick 2.3
24+import Ubuntu.Components 1.1
25+
26+AbstractButton {
27+ id: abstractButton
28+
29+ property string iconName
30+
31+ Rectangle {
32+ visible: abstractButton.pressed
33+ anchors.fill: parent
34+ color: podbird.theme.hightlightListView
35+ }
36+
37+ Icon {
38+ id: _icon
39+ width: units.gu(2.5)
40+ height: width
41+ anchors.centerIn: parent
42+ name: abstractButton.iconName
43+ color: podbird.theme.baseIcon
44+ }
45+}
46
47=== modified file 'app/ui/EpisodesPage.qml'
48--- app/ui/EpisodesPage.qml 2015-03-27 15:31:54 +0000
49+++ app/ui/EpisodesPage.qml 2015-03-27 15:31:54 +0000
50@@ -386,12 +386,15 @@
51 Row {
52 id: actionRow
53
54- spacing: units.gu(2)
55 anchors.left: parent.left
56-
57- MouseArea {
58- width: units.gu(3.5)
59- height: width
60+ anchors.leftMargin: units.gu(-1.5)
61+
62+ ActionButton {
63+ width: units.gu(5)
64+ height: units.gu(4)
65+
66+ iconName: player.playbackState === MediaPlayer.PlayingState && currentGuid === model.guid ? "media-playback-pause"
67+ : "media-playback-start"
68
69 onClicked: {
70 var db = Podcasts.init();
71@@ -415,23 +418,19 @@
72 }
73 });
74 }
75-
76- Icon {
77- id: playButton
78- name: player.playbackState === MediaPlayer.PlayingState && currentGuid === model.guid ? "media-playback-pause"
79- : "media-playback-start"
80- width: units.gu(2.5)
81- color: podbird.theme.baseIcon
82- height: width
83- anchors.centerIn: parent
84- }
85 }
86
87- Item {
88+ ActionButton {
89 id: downloadButton
90
91- width: units.gu(3.5)
92- height: width
93+ width: units.gu(5)
94+ height: units.gu(4)
95+
96+ property bool queued: false
97+
98+ iconName: model.downloadedfile ? "delete" : (queued && downloader.downloadingGuid !== model.guid ? "history" : "save")
99+ opacity: downloader.downloadingGuid === model.guid ? 0.4 : 1.0
100+ enabled: downloader.downloadingGuid !== model.guid
101
102 ActivityIndicator {
103 anchors.centerIn: parent
104@@ -439,38 +438,23 @@
105 running: visible
106 }
107
108- Icon {
109- id: downloadIcon
110- property bool queued: false;
111- name: model.downloadedfile ? "delete" : (queued && downloader.downloadingGuid !== model.guid ? "history" : "save")
112- anchors.centerIn: parent
113- width: units.gu(2.5)
114- height: width
115- color: podbird.theme.baseIcon
116- opacity: downloader.downloadingGuid === model.guid ? 0.4 : 1.0
117- }
118-
119- MouseArea {
120- anchors.fill: parent
121- enabled: downloader.downloadingGuid !== model.guid
122-
123- onClicked: {
124- if (model.downloadedfile) {
125- fileManager.deleteFile(model.downloadedfile);
126- var db = Podcasts.init();
127- db.transaction(function (tx) {
128- tx.executeSql("UPDATE Episode SET downloadedfile = NULL WHERE guid = ?", [model.guid]);
129- });
130- loadEpisodes(episodeModel.pid, episodeModel.artist, episodeModel.image);
131- } else {
132- downloadIcon.queued = true;
133- downloader.addDownload(model.guid, model.audiourl);
134- }
135+ onClicked: {
136+ if (model.downloadedfile) {
137+ fileManager.deleteFile(model.downloadedfile);
138+ var db = Podcasts.init();
139+ db.transaction(function (tx) {
140+ tx.executeSql("UPDATE Episode SET downloadedfile = NULL WHERE guid = ?", [model.guid]);
141+ });
142+ loadEpisodes(episodeModel.pid, episodeModel.artist, episodeModel.image);
143+ } else {
144+ downloadButton.queued = true;
145+ downloader.addDownload(model.guid, model.audiourl);
146 }
147 }
148 }
149 }
150
151+
152 ProgressBar {
153 visible: downloader.downloadingGuid === model.guid
154 minimumValue: 0
155
156=== modified file 'app/ui/NowPlayingPage.qml'
157--- app/ui/NowPlayingPage.qml 2015-03-27 15:31:54 +0000
158+++ app/ui/NowPlayingPage.qml 2015-03-27 15:31:54 +0000
159@@ -125,7 +125,7 @@
160 anchors.horizontalCenter: parent.horizontalCenter
161 spacing: units.gu(2)
162
163- MouseArea {
164+ AbstractButton {
165 id: skipBackwardButton
166 width: units.gu(6)
167 height: width
168@@ -158,7 +158,7 @@
169 }
170 }
171
172- MouseArea {
173+ AbstractButton {
174 id: playButton
175 width: units.gu(10)
176 height: width
177@@ -176,7 +176,7 @@
178 }
179 }
180
181- MouseArea {
182+ AbstractButton {
183 id: skipForwardButton
184 width: units.gu(6)
185 height: width
186
187=== modified file 'app/ui/PlayerControls.qml'
188--- app/ui/PlayerControls.qml 2015-03-27 15:31:54 +0000
189+++ app/ui/PlayerControls.qml 2015-03-27 15:31:54 +0000
190@@ -60,7 +60,7 @@
191
192 Column {
193 anchors.verticalCenter: parent.verticalCenter
194- anchors.right: playButtonBackground.left
195+ anchors.right: playButton.left
196 anchors.left: cover.right
197 anchors.leftMargin: units.gu(2)
198
199@@ -87,32 +87,36 @@
200 }
201 }
202
203- Rectangle {
204- id: playButtonBackground
205+ AbstractButton {
206+ id: playButton
207+
208 width: units.gu(7)
209 height: cover.height
210- color: "#FFF"
211- opacity: play.pressed ? 0.1 : 0
212- visible: controlRect.height > 0
213 anchors.verticalCenter: parent.verticalCenter
214 anchors.right: parent.right
215+ enabled: controlRect.height > 0
216+ visible: enabled
217
218- MouseArea {
219- id: play
220+ Rectangle {
221+ id: playButtonBackground
222 anchors.fill: parent
223- onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause()
224- : player.play()
225- }
226- }
227-
228- Icon {
229- color: "white"
230- width: units.gu(3)
231- height: width
232- anchors.centerIn: playButtonBackground
233- name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause"
234- : "media-playback-start"
235- opacity: play.pressed ? 0.4 : 1.0
236+ color: "#FFF"
237+ opacity: 0.1
238+ visible: playButton.pressed
239+ }
240+
241+ onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause()
242+ : player.play()
243+
244+ Icon {
245+ color: "white"
246+ width: units.gu(3)
247+ height: width
248+ anchors.centerIn: playButtonBackground
249+ name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause"
250+ : "media-playback-start"
251+ opacity: playButton.pressed ? 0.4 : 1.0
252+ }
253 }
254 }
255 }
256
257=== modified file 'po/com.mikeasoft.podbird.pot'
258--- po/com.mikeasoft.podbird.pot 2015-03-27 15:31:54 +0000
259+++ po/com.mikeasoft.podbird.pot 2015-03-27 15:31:54 +0000
260@@ -8,7 +8,7 @@
261 msgstr ""
262 "Project-Id-Version: \n"
263 "Report-Msgid-Bugs-To: \n"
264-"POT-Creation-Date: 2015-03-27 16:25+0100\n"
265+"POT-Creation-Date: 2015-03-27 16:30+0100\n"
266 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
267 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
268 "Language-Team: LANGUAGE <LL@li.org>\n"
269@@ -168,6 +168,6 @@
270 msgid "Theme"
271 msgstr ""
272
273-#: /home/krnekhelesh/Documents/Ubuntu-Projects/MP-Reviews/builddir/build-1-add-theming-support-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_14_10_utopic-Default/po/Podbird.desktop.in.h:1
274+#: /home/krnekhelesh/Documents/Ubuntu-Projects/MP-Reviews/builddir/build-2-add-button-feedback-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_14_10_utopic-Default/po/Podbird.desktop.in.h:1
275 msgid "Podbird"
276 msgstr ""

Subscribers

People subscribed via source and target branches