Merge lp:~nik90/podbird/dev-renable-theme into lp:podbird/devel

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 112
Merged at revision: 110
Proposed branch: lp:~nik90/podbird/dev-renable-theme
Merge into: lp:podbird/devel
Diff against target: 225 lines (+110/-23)
5 files modified
app/components/HeaderListItem.qml (+21/-4)
app/components/SingleValueListItem.qml (+52/-0)
app/components/SubtitledListItem.qml (+2/-2)
app/settings/ThemeSetting.qml (+25/-3)
app/ui/SettingsPage.qml (+10/-14)
To merge this branch: bzr merge lp:~nik90/podbird/dev-renable-theme
Reviewer Review Type Date Requested Status
Podbird Developers Pending
Review via email: mp+262508@code.launchpad.net

Commit message

Re-enabling theming and also remove deprecated ListItem.SingleValue listitem.

Description of the change

Re-enabling theming and also remove deprecated ListItem.SingleValue listitem.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/components/HeaderListItem.qml'
2--- app/components/HeaderListItem.qml 2015-05-07 11:29:06 +0000
3+++ app/components/HeaderListItem.qml 2015-06-19 21:41:08 +0000
4@@ -1,4 +1,22 @@
5-import QtQuick 2.3
6+/*
7+ * Copyright 2015 Podbird Team
8+ *
9+ * This file is part of Podbird.
10+ *
11+ * Podbird is free software; you can redistribute it and/or modify
12+ * it under the terms of the GNU General Public License as published by
13+ * the Free Software Foundation; version 3.
14+ *
15+ * Podbird is distributed in the hope that it will be useful,
16+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
17+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+ * GNU General Public License for more details.
19+ *
20+ * You should have received a copy of the GNU General Public License
21+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
22+ */
23+
24+import QtQuick 2.4
25 import Ubuntu.Components 1.2
26
27 ListItem {
28@@ -7,11 +25,10 @@
29 property alias title: headerText.text
30
31 height: headerText.implicitHeight + units.gu(1)
32+
33 Label {
34 id: headerText
35- anchors.left: parent.left
36- anchors.leftMargin: units.gu(2)
37- anchors.verticalCenter: parent.verticalCenter
38+ anchors { left: parent.left; leftMargin: units.gu(2); verticalCenter: parent.verticalCenter }
39 font.weight: Font.DemiBold
40 }
41 }
42
43=== added file 'app/components/SingleValueListItem.qml'
44--- app/components/SingleValueListItem.qml 1970-01-01 00:00:00 +0000
45+++ app/components/SingleValueListItem.qml 2015-06-19 21:41:08 +0000
46@@ -0,0 +1,52 @@
47+/*
48+ * Copyright 2015 Podbird Team
49+ *
50+ * This file is part of Podbird.
51+ *
52+ * Podbird is free software; you can redistribute it and/or modify
53+ * it under the terms of the GNU General Public License as published by
54+ * the Free Software Foundation; version 3.
55+ *
56+ * Podbird is distributed in the hope that it will be useful,
57+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
58+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
59+ * GNU General Public License for more details.
60+ *
61+ * You should have received a copy of the GNU General Public License
62+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
63+ */
64+
65+import QtQuick 2.4
66+import QtQuick.Layouts 1.1
67+import Ubuntu.Components 1.2
68+
69+ListItem {
70+ id: customListItem
71+
72+ property alias text: _title.text
73+ property alias value: _value.text
74+
75+ RowLayout {
76+ spacing: units.gu(1)
77+ anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; margins: units.gu(2) }
78+
79+ Label {
80+ id: _title
81+ Layout.fillWidth: true
82+ }
83+
84+ Label {
85+ id: _value
86+ elide: Text.ElideMiddle
87+ horizontalAlignment: Text.AlignRight
88+ Layout.maximumWidth: parent.width - _title.implicitWidth - _progression.width - units.gu(2)
89+ }
90+
91+ Icon {
92+ id: _progression
93+ name: "go-next"
94+ width: units.gu(2)
95+ height: width
96+ }
97+ }
98+}
99
100=== modified file 'app/components/SubtitledListItem.qml'
101--- app/components/SubtitledListItem.qml 2015-05-07 11:29:06 +0000
102+++ app/components/SubtitledListItem.qml 2015-06-19 21:41:08 +0000
103@@ -16,7 +16,7 @@
104 * along with this program. If not, see <http://www.gnu.org/licenses/>.
105 */
106
107-import QtQuick 2.3
108+import QtQuick 2.4
109 import Ubuntu.Components 1.2
110
111 ListItem {
112@@ -45,7 +45,7 @@
113 width: parent.width
114 wrapMode: Text.WordWrap
115 }
116-
117+
118 Label {
119 id: _subtitle
120 fontSize: "small"
121
122=== modified file 'app/settings/ThemeSetting.qml'
123--- app/settings/ThemeSetting.qml 2015-05-07 11:29:06 +0000
124+++ app/settings/ThemeSetting.qml 2015-06-19 21:41:08 +0000
125@@ -18,6 +18,7 @@
126
127 import QtQuick 2.3
128 import Ubuntu.Components 1.2
129+import Ubuntu.Components.Popups 1.0
130 import "../components"
131
132 Page {
133@@ -26,6 +27,28 @@
134 visible: false
135 title: i18n.tr("Theme")
136
137+ /*
138+ Note (nik90): After the upgrade to Ubuntu.Components 1.2, dynamic application theme switching is broken. This
139+ has been reported upstream at http://pad.lv/1462690. Until this is fixed, users will have to restart the app
140+ when switching application theme. This dialog explains that to the user.
141+ */
142+ Component {
143+ id: rebootAppDialog
144+ Dialog {
145+ id: dialogInternal
146+ title: i18n.tr("Restart %1").arg("Podbird")
147+ text: i18n.tr("You will need to restart %1 to change the application theme. \
148+ This is necessary to avoid any strange behaviour in the app. We apologize for the inconvenience").arg("Podbird")
149+ Button {
150+ text: i18n.tr("Exit App")
151+ color: podbird.appTheme.positiveActionButton
152+ onClicked: {
153+ Qt.quit()
154+ }
155+ }
156+ }
157+ }
158+
159 ListModel {
160 id: themeModel
161 Component.onCompleted: initialize()
162@@ -56,9 +79,8 @@
163 divider.visible: true
164
165 onClicked: {
166- var themeElement = model.file
167- podbird.settings.themeName = themeElement
168- podbird.appThemeManager.source = themeElement
169+ podbird.settings.themeName = model.file
170+ PopupUtils.open(rebootAppDialog, themeSettingPage);
171 }
172
173 Icon {
174
175=== modified file 'app/ui/SettingsPage.qml'
176--- app/ui/SettingsPage.qml 2015-05-12 22:09:49 +0000
177+++ app/ui/SettingsPage.qml 2015-06-19 21:41:08 +0000
178@@ -19,7 +19,6 @@
179 import QtQuick 2.3
180 import Ubuntu.Components 1.2
181 import Ubuntu.Components.Popups 1.0
182-import Ubuntu.Components.ListItems 1.0 as ListItems
183 import "../components"
184
185 Page {
186@@ -131,29 +130,26 @@
187 onClicked: podbird.settings.showListView = !podbird.settings.showListView
188 }
189
190-// ListItems.SingleValue {
191-// progression: true
192-// showDivider: false
193-// text: i18n.tr("Theme")
194-// value: podbird.settings.themeName.split(".qml")[0] === "Light" ? i18n.tr("Light") : i18n.tr("Dark")
195-// onClicked: mainStack.push(Qt.resolvedUrl("../settings/ThemeSetting.qml"))
196-// }
197+ SingleValueListItem {
198+ divider.visible: false
199+ text: i18n.tr("Theme")
200+ value: podbird.settings.themeName.split(".qml")[0] === "Light" ? i18n.tr("Light") : i18n.tr("Dark")
201+ onClicked: mainStack.push(Qt.resolvedUrl("../settings/ThemeSetting.qml"))
202+ }
203
204 HeaderListItem {
205 title: i18n.tr("Playback Settings")
206 }
207
208- ListItems.SingleValue {
209- progression: true
210- showDivider: false
211+ SingleValueListItem {
212+ divider.visible: false
213 text: i18n.tr("Skip Forward")
214 value: i18n.tr("%1 seconds").arg(podbird.settings.skipForward)
215 onClicked: PopupUtils.open(skipForwardDialog, settingsPage);
216 }
217
218- ListItems.SingleValue {
219- progression: true
220- showDivider: false
221+ SingleValueListItem {
222+ divider.visible: false
223 text: i18n.tr("Skip Back")
224 value: i18n.tr("%1 seconds").arg(podbird.settings.skipBack)
225 onClicked: PopupUtils.open(skipBackDialog, settingsPage);

Subscribers

People subscribed via source and target branches