Merge lp:~mpredotka/ubuntu-clock-app/app-window-size into lp:ubuntu-clock-app

Proposed by Michal Predotka
Status: Merged
Approved by: Bartosz Kosiorek
Approved revision: 481
Merged at revision: 481
Proposed branch: lp:~mpredotka/ubuntu-clock-app/app-window-size
Merge into: lp:ubuntu-clock-app
Diff against target: 258 lines (+90/-87)
5 files modified
app/alarm/AlarmSettingsPage.qml (+2/-1)
app/alarm/AlarmSound.qml (+1/-1)
app/clock/ClockPage.qml (+1/-1)
app/ubuntu-clock-app.qml (+85/-83)
app/worldclock/WorldCityList.qml (+1/-1)
To merge this branch: bzr merge lp:~mpredotka/ubuntu-clock-app/app-window-size
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+299980@code.launchpad.net

Commit message

Set min and max size for the app window

Description of the change

Added Window component with min width 40gu, max width 50gu and min height 70gu. Tested only on desktop.

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

It's works correctly for me.
Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmSettingsPage.qml'
2--- app/alarm/AlarmSettingsPage.qml 2016-03-03 10:24:42 +0000
3+++ app/alarm/AlarmSettingsPage.qml 2016-07-13 17:38:30 +0000
4@@ -33,7 +33,7 @@
5 }
6
7 Connections {
8- target: clockApp
9+ target: rootWindow
10 onApplicationStateChanged: {
11 localTimeSource.update()
12 }
13@@ -100,6 +100,7 @@
14 }
15
16 Slider {
17+ width: Math.min(parent.width, units.gu(40))
18 minimumValue: 1
19 maximumValue: 100
20 live: true
21
22=== modified file 'app/alarm/AlarmSound.qml'
23--- app/alarm/AlarmSound.qml 2016-03-16 16:14:15 +0000
24+++ app/alarm/AlarmSound.qml 2016-07-13 17:38:30 +0000
25@@ -139,7 +139,7 @@
26 }
27
28 Connections {
29- target: clockApp
30+ target: rootWindow
31 onApplicationStateChanged: {
32 previewAlarmSound.stop()
33 }
34
35=== modified file 'app/clock/ClockPage.qml'
36--- app/clock/ClockPage.qml 2016-03-21 19:03:05 +0000
37+++ app/clock/ClockPage.qml 2016-07-13 17:38:30 +0000
38@@ -119,7 +119,7 @@
39 }
40
41 Connections {
42- target: clockApp
43+ target: rootWindow
44 onApplicationStateChanged: {
45 /*
46 If Clock App is brought from background after more than 30 mins,
47
48=== modified file 'app/ubuntu-clock-app.qml'
49--- app/ubuntu-clock-app.qml 2016-02-26 09:46:21 +0000
50+++ app/ubuntu-clock-app.qml 2016-07-13 17:38:30 +0000
51@@ -22,109 +22,111 @@
52 import Alarm 1.0
53 import Ubuntu.Components 1.3
54 import "components"
55+import QtQuick.Window 2.2
56
57-MainView {
58- id: clockApp
59+Window {
60+ id: rootWindow
61
62 // Property to store the state of an application (active or suspended)
63 property bool applicationState: Qt.application.active
64
65- // objectName for functional testing purposes (autopilot-qt5)
66- objectName: "clockMainView"
67-
68- // applicationName for click packages (used as an unique app identifier)
69- applicationName: "com.ubuntu.clock"
70-
71- /*
72- This property enables the application to change orientation when the
73- device is rotated. This has been set to false since we are currently
74- only focussing on the phone interface.
75- */
76- automaticOrientation: false
77-
78- /*
79- The width and height defined below are the same dimension used by the
80- designers in the clock visual spec.
81- */
82- width: units.gu(40)
83- height: units.gu(70)
84-
85- backgroundColor: "#FFFFFF"
86-
87- anchorToKeyboard: true
88-
89- // Database to store the user preferences locally
90- U1db.Database {
91- id: clockDB
92- path: "user-preferences"
93- }
94-
95- // Document to store clock mode chosen by user
96- U1db.Document {
97- id: clockModeDocument
98- create: true
99- database: clockDB
100- docId: "clockModeDocument"
101- defaults: { "digitalMode": false }
102- }
103-
104- U1db.Document {
105- id: userLocationDocument
106- create: true
107- database: clockDB
108- docId: "userLocationDocument"
109- defaults: { "lat": "NaN", "long": "Nan", "location": "Null" }
110- }
111-
112- DateTime {
113- id: localTimeSource
114- updateInterval: 1000
115- }
116-
117- AlarmSound {
118- id: alarmSoundHelper
119- // Create CustomSounds directory if it does not exist on app startup
120- Component.onCompleted: createCustomAlarmSoundDirectory()
121- }
122+ /*
123+ The width and height defined below are the same dimension used by the
124+ designers in the clock visual spec.
125+*/
126+
127+ minimumWidth: units.gu(40)
128+ minimumHeight: units.gu(70)
129+ maximumWidth: units.gu(50)
130
131 onApplicationStateChanged: {
132 localTimeSource.update()
133 /*
134- Reload the alarm model when the clock app gains focus to refresh
135- the alarm page UI in the case of alarm notifications.
136- */
137+ Reload the alarm model when the clock app gains focus to refresh
138+ the alarm page UI in the case of alarm notifications.
139+ */
140 if(applicationState && !mainPage.isColdStart && (mainStack.currentPage.isMainPage
141- || mainStack.currentPage.isAlarmPage)) {
142+ || mainStack.currentPage.isAlarmPage)) {
143 console.log("[LOG]: Alarm Database unloaded")
144 alarmModelLoader.source = ""
145 alarmModelLoader.source = Qt.resolvedUrl("alarm/AlarmModelComponent.qml")
146 }
147 }
148
149- PageStack {
150- id: mainStack
151-
152- Component.onCompleted: push(mainPage)
153-
154- MainPage {
155- id: mainPage
156-
157- readonly property bool isMainPage: true
158-
159- Loader {
160- id: alarmModelLoader
161- asynchronous: false
162- }
163-
164- alarmModel: alarmModelLoader.item
165- /*
166+ MainView {
167+ id: clockApp
168+
169+ // objectName for functional testing purposes (autopilot-qt5)
170+ objectName: "clockMainView"
171+
172+ // applicationName for click packages (used as an unique app identifier)
173+ applicationName: "com.ubuntu.clock"
174+
175+ backgroundColor: "#FFFFFF"
176+
177+ anchors.fill: parent
178+
179+ anchorToKeyboard: true
180+
181+ // Database to store the user preferences locally
182+ U1db.Database {
183+ id: clockDB
184+ path: "user-preferences"
185+ }
186+
187+ // Document to store clock mode chosen by user
188+ U1db.Document {
189+ id: clockModeDocument
190+ create: true
191+ database: clockDB
192+ docId: "clockModeDocument"
193+ defaults: { "digitalMode": false }
194+ }
195+
196+ U1db.Document {
197+ id: userLocationDocument
198+ create: true
199+ database: clockDB
200+ docId: "userLocationDocument"
201+ defaults: { "lat": "NaN", "long": "Nan", "location": "Null" }
202+ }
203+
204+ DateTime {
205+ id: localTimeSource
206+ updateInterval: 1000
207+ }
208+
209+ AlarmSound {
210+ id: alarmSoundHelper
211+ // Create CustomSounds directory if it does not exist on app startup
212+ Component.onCompleted: createCustomAlarmSoundDirectory()
213+ }
214+
215+ PageStack {
216+ id: mainStack
217+
218+ Component.onCompleted: push(mainPage)
219+
220+ MainPage {
221+ id: mainPage
222+
223+ readonly property bool isMainPage: true
224+
225+ Loader {
226+ id: alarmModelLoader
227+ asynchronous: false
228+ }
229+
230+ alarmModel: alarmModelLoader.item
231+ /*
232 FIXME: When the upstream QT bug at
233 https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed
234 it will be possible to receive a datetime object directly for notLocalizedDateTimeString variable.
235 */
236- notLocalizedDateTimeString: localTimeSource.notLocalizedCurrentDateTimeString
237- localizedTimeString: localTimeSource.localizedCurrentTimeString
238- localizedDateString: localTimeSource.localizedCurrentDateString
239+ notLocalizedDateTimeString: localTimeSource.notLocalizedCurrentDateTimeString
240+ localizedTimeString: localTimeSource.localizedCurrentTimeString
241+ localizedDateString: localTimeSource.localizedCurrentDateString
242+ }
243 }
244 }
245 }
246
247=== modified file 'app/worldclock/WorldCityList.qml'
248--- app/worldclock/WorldCityList.qml 2016-03-21 19:10:42 +0000
249+++ app/worldclock/WorldCityList.qml 2016-07-13 17:38:30 +0000
250@@ -144,7 +144,7 @@
251 }
252
253 Connections {
254- target: clockApp
255+ target: rootWindow
256 onApplicationStateChanged: {
257 /*
258 Update world city list immediately when the clock app is brought

Subscribers

People subscribed via source and target branches