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
=== modified file 'app/alarm/AlarmSettingsPage.qml'
--- app/alarm/AlarmSettingsPage.qml 2016-03-03 10:24:42 +0000
+++ app/alarm/AlarmSettingsPage.qml 2016-07-13 17:38:30 +0000
@@ -33,7 +33,7 @@
33 }33 }
3434
35 Connections {35 Connections {
36 target: clockApp36 target: rootWindow
37 onApplicationStateChanged: {37 onApplicationStateChanged: {
38 localTimeSource.update()38 localTimeSource.update()
39 }39 }
@@ -100,6 +100,7 @@
100 }100 }
101101
102 Slider {102 Slider {
103 width: Math.min(parent.width, units.gu(40))
103 minimumValue: 1104 minimumValue: 1
104 maximumValue: 100105 maximumValue: 100
105 live: true106 live: true
106107
=== modified file 'app/alarm/AlarmSound.qml'
--- app/alarm/AlarmSound.qml 2016-03-16 16:14:15 +0000
+++ app/alarm/AlarmSound.qml 2016-07-13 17:38:30 +0000
@@ -139,7 +139,7 @@
139 }139 }
140140
141 Connections {141 Connections {
142 target: clockApp142 target: rootWindow
143 onApplicationStateChanged: {143 onApplicationStateChanged: {
144 previewAlarmSound.stop()144 previewAlarmSound.stop()
145 }145 }
146146
=== modified file 'app/clock/ClockPage.qml'
--- app/clock/ClockPage.qml 2016-03-21 19:03:05 +0000
+++ app/clock/ClockPage.qml 2016-07-13 17:38:30 +0000
@@ -119,7 +119,7 @@
119 }119 }
120120
121 Connections {121 Connections {
122 target: clockApp122 target: rootWindow
123 onApplicationStateChanged: {123 onApplicationStateChanged: {
124 /*124 /*
125 If Clock App is brought from background after more than 30 mins,125 If Clock App is brought from background after more than 30 mins,
126126
=== modified file 'app/ubuntu-clock-app.qml'
--- app/ubuntu-clock-app.qml 2016-02-26 09:46:21 +0000
+++ app/ubuntu-clock-app.qml 2016-07-13 17:38:30 +0000
@@ -22,109 +22,111 @@
22import Alarm 1.022import Alarm 1.0
23import Ubuntu.Components 1.323import Ubuntu.Components 1.3
24import "components"24import "components"
25import QtQuick.Window 2.2
2526
26MainView {27Window {
27 id: clockApp28 id: rootWindow
2829
29 // Property to store the state of an application (active or suspended)30 // Property to store the state of an application (active or suspended)
30 property bool applicationState: Qt.application.active31 property bool applicationState: Qt.application.active
3132
32 // objectName for functional testing purposes (autopilot-qt5)33 /*
33 objectName: "clockMainView"34 The width and height defined below are the same dimension used by the
3435 designers in the clock visual spec.
35 // applicationName for click packages (used as an unique app identifier)36*/
36 applicationName: "com.ubuntu.clock"37
3738 minimumWidth: units.gu(40)
38 /*39 minimumHeight: units.gu(70)
39 This property enables the application to change orientation when the40 maximumWidth: units.gu(50)
40 device is rotated. This has been set to false since we are currently
41 only focussing on the phone interface.
42 */
43 automaticOrientation: false
44
45 /*
46 The width and height defined below are the same dimension used by the
47 designers in the clock visual spec.
48 */
49 width: units.gu(40)
50 height: units.gu(70)
51
52 backgroundColor: "#FFFFFF"
53
54 anchorToKeyboard: true
55
56 // Database to store the user preferences locally
57 U1db.Database {
58 id: clockDB
59 path: "user-preferences"
60 }
61
62 // Document to store clock mode chosen by user
63 U1db.Document {
64 id: clockModeDocument
65 create: true
66 database: clockDB
67 docId: "clockModeDocument"
68 defaults: { "digitalMode": false }
69 }
70
71 U1db.Document {
72 id: userLocationDocument
73 create: true
74 database: clockDB
75 docId: "userLocationDocument"
76 defaults: { "lat": "NaN", "long": "Nan", "location": "Null" }
77 }
78
79 DateTime {
80 id: localTimeSource
81 updateInterval: 1000
82 }
83
84 AlarmSound {
85 id: alarmSoundHelper
86 // Create CustomSounds directory if it does not exist on app startup
87 Component.onCompleted: createCustomAlarmSoundDirectory()
88 }
8941
90 onApplicationStateChanged: {42 onApplicationStateChanged: {
91 localTimeSource.update()43 localTimeSource.update()
92 /*44 /*
93 Reload the alarm model when the clock app gains focus to refresh45 Reload the alarm model when the clock app gains focus to refresh
94 the alarm page UI in the case of alarm notifications.46 the alarm page UI in the case of alarm notifications.
95 */47 */
96 if(applicationState && !mainPage.isColdStart && (mainStack.currentPage.isMainPage48 if(applicationState && !mainPage.isColdStart && (mainStack.currentPage.isMainPage
97 || mainStack.currentPage.isAlarmPage)) {49 || mainStack.currentPage.isAlarmPage)) {
98 console.log("[LOG]: Alarm Database unloaded")50 console.log("[LOG]: Alarm Database unloaded")
99 alarmModelLoader.source = ""51 alarmModelLoader.source = ""
100 alarmModelLoader.source = Qt.resolvedUrl("alarm/AlarmModelComponent.qml")52 alarmModelLoader.source = Qt.resolvedUrl("alarm/AlarmModelComponent.qml")
101 }53 }
102 }54 }
10355
104 PageStack {56 MainView {
105 id: mainStack57 id: clockApp
10658
107 Component.onCompleted: push(mainPage)59 // objectName for functional testing purposes (autopilot-qt5)
10860 objectName: "clockMainView"
109 MainPage {61
110 id: mainPage62 // applicationName for click packages (used as an unique app identifier)
11163 applicationName: "com.ubuntu.clock"
112 readonly property bool isMainPage: true64
11365 backgroundColor: "#FFFFFF"
114 Loader {66
115 id: alarmModelLoader67 anchors.fill: parent
116 asynchronous: false68
117 }69 anchorToKeyboard: true
11870
119 alarmModel: alarmModelLoader.item71 // Database to store the user preferences locally
120 /*72 U1db.Database {
73 id: clockDB
74 path: "user-preferences"
75 }
76
77 // Document to store clock mode chosen by user
78 U1db.Document {
79 id: clockModeDocument
80 create: true
81 database: clockDB
82 docId: "clockModeDocument"
83 defaults: { "digitalMode": false }
84 }
85
86 U1db.Document {
87 id: userLocationDocument
88 create: true
89 database: clockDB
90 docId: "userLocationDocument"
91 defaults: { "lat": "NaN", "long": "Nan", "location": "Null" }
92 }
93
94 DateTime {
95 id: localTimeSource
96 updateInterval: 1000
97 }
98
99 AlarmSound {
100 id: alarmSoundHelper
101 // Create CustomSounds directory if it does not exist on app startup
102 Component.onCompleted: createCustomAlarmSoundDirectory()
103 }
104
105 PageStack {
106 id: mainStack
107
108 Component.onCompleted: push(mainPage)
109
110 MainPage {
111 id: mainPage
112
113 readonly property bool isMainPage: true
114
115 Loader {
116 id: alarmModelLoader
117 asynchronous: false
118 }
119
120 alarmModel: alarmModelLoader.item
121 /*
121 FIXME: When the upstream QT bug at122 FIXME: When the upstream QT bug at
122 https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed123 https://bugreports.qt-project.org/browse/QTBUG-40275 is fixed
123 it will be possible to receive a datetime object directly for notLocalizedDateTimeString variable.124 it will be possible to receive a datetime object directly for notLocalizedDateTimeString variable.
124 */125 */
125 notLocalizedDateTimeString: localTimeSource.notLocalizedCurrentDateTimeString126 notLocalizedDateTimeString: localTimeSource.notLocalizedCurrentDateTimeString
126 localizedTimeString: localTimeSource.localizedCurrentTimeString127 localizedTimeString: localTimeSource.localizedCurrentTimeString
127 localizedDateString: localTimeSource.localizedCurrentDateString128 localizedDateString: localTimeSource.localizedCurrentDateString
129 }
128 }130 }
129 }131 }
130}132}
131133
=== modified file 'app/worldclock/WorldCityList.qml'
--- app/worldclock/WorldCityList.qml 2016-03-21 19:10:42 +0000
+++ app/worldclock/WorldCityList.qml 2016-07-13 17:38:30 +0000
@@ -144,7 +144,7 @@
144 }144 }
145145
146 Connections {146 Connections {
147 target: clockApp147 target: rootWindow
148 onApplicationStateChanged: {148 onApplicationStateChanged: {
149 /*149 /*
150 Update world city list immediately when the clock app is brought150 Update world city list immediately when the clock app is brought

Subscribers

People subscribed via source and target branches