Debian Codegraph @

src/app/qml/ui/SettingsPage.qml

raw
1 /*
2 * Copyright (C) 2015-2016 Canonical Ltd.
3 *
4 * This file is part of Lomiri Weather App
5 *
6 * Lomiri Weather App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Lomiri Weather App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 import QtQuick 2.12
20 import Lomiri.Components 1.3
21 import "../components"
22 import "settings"
23 Page {
24 id: settingsPage
25
26 header: PageHeader {
27 id: header
28 title: i18n.tr("Settings")
29
30 trailingActionBar {
31 actions: [
32 Action {
33 iconName: "info"
34 objectName: "aboutButton"
35 onTriggered: mainPageStack.push(Qt.resolvedUrl("../components/AboutGeneral.qml"))
36 },
37 Action {
38 iconName: "help"
39 objectName: "helpButton"
40 onTriggered: mainPageStack.push(Qt.resolvedUrl("../components/About.qml"))
41 }
42 ]
43 objectName: "settingsTrailingActionBar"
44 }
45 }
46
47 property bool bug1341671workaround: true
48
49 Flickable {
50 id: settingsFlickable
51 clip: true
52 flickableDirection: Flickable.AutoFlickIfNeeded
53 boundsBehavior: Flickable.StopAtBounds
54
55 anchors {
56 topMargin: settingsPage.header.height + units.gu(2)
57 fill: parent
58 }
59
60 contentHeight: settingsColumn.childrenRect.height
61
62 Column {
63 id: settingsColumn
64 spacing: units.gu(1.5)
65 property real elementHeight: units.gu(6)
66
67 anchors {
68 top: parent.top
69 left: parent.left
70 right: parent.right
71 leftMargin: units.gu(2)
72 rightMargin: units.gu(2)
73 }
74
75 ListItem {
76 width: parent.width
77 height: dpp.height > 0 ? dpp.height : elementHeight
78 divider.visible: false
79
80 DataProviderPage {
81 id: dpp
82 width: parent.width
83 }
84 }
85
86 ListItem {
87 width: parent.width
88 height: fdp.height > 0 ? fdp.height : elementHeight
89 divider.visible: false
90
91 ForecastDaysPage {
92 id: fdp
93 width: parent.width
94 }
95 }
96
97 ListItem {
98 width: parent.width
99 height: ripg.height > 0 ? ripg.height : elementHeight
100 divider.visible: false
101
102 RefreshIntervalPage {
103 id: ripg
104 width: parent.width
105 }
106 }
107 Label {
108 text: "(" + i18n.tr("Data is only updated while the app is open and focused") + ")"
109 color: theme.palette.normal.backgroundTertiaryText
110 width: parent.width
111 wrapMode: Text.WordWrap
112 font.italic: true
113 fontSize: "small"
114 }
115
116 ListItem {
117 width: parent.width
118 height: wupg.height > 0 ? wupg.height : elementHeight
119 divider.visible: false
120
121 WindUnitPage {
122 id: wupg
123 width: parent.width
124 }
125 }
126
127 ListItem {
128 width: parent.width
129 height: upg.height > 0 ? upg.height : elementHeight
130 divider.visible: false
131
132 TempUnitPage {
133 id: upg
134 width: parent.width
135 }
136 }
137
138 ListItem {
139 width: parent.width
140 height: rpg.height > 0 ? rpg.height : elementHeight
141 divider.visible: false
142
143 RainUnitPage {
144 id: rpg
145 width: parent.width
146 }
147 }
148
149 ListItem {
150 width: parent.width
151 height: spg.height > 0 ? spg.height : elementHeight
152 divider.visible: false
153
154 SnowUnitPage {
155 id: spg
156 width: parent.width
157 }
158 }
159
160 ListItem {
161 width: parent.width
162 height: tcp.height > 0 ? tcp.height : elementHeight
163 divider.visible: false
164
165 TemperatureColorPage {
166 id: tcp
167 width: parent.width
168 }
169 }
170
171 ListItem {
172 width: parent.width
173 height: tpg.height > 0 ? tpg.height : elementHeight
174 divider.visible: false
175
176 ThemePage {
177 id: tpg
178 width: parent.width
179 }
180 }
181
182 ListItem {
183 width: parent.width
184 height: tbcp.height > 0 ? tbcp.height : elementHeight
185 divider.visible: false
186
187 TodayColorPage {
188 id: tbcp
189 width: parent.width
190 }
191 }
192
193 ListItem {
194 width: parent.width
195 height: lpg.height > 0 ? lpg.height : elementHeight
196 divider.visible: false
197
198 LocationPage {
199 id: lpg
200 width: parent.width
201 }
202 }
203 }
204 }
205 }