Merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Redesign into lp:ubuntu-calendar-app

Proposed by Kunal Parmar
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 561
Merged at revision: 567
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Redesign
Merge into: lp:ubuntu-calendar-app
Prerequisite: lp:~pkunal-parmar/ubuntu-calendar-app/NewDayView-Final
Diff against target: 259 lines (+100/-120)
2 files modified
EventBubble.qml (+98/-119)
tests/autopilot/calendar_app/__init__.py (+2/-1)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Redesign
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Ubuntu Calendar Developers Pending
Review via email: mp+245259@code.launchpad.net

Commit message

Event Bubble redesign

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Rebuilding Jenkins

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'EventBubble.qml'
--- EventBubble.qml 2014-11-29 05:15:13 +0000
+++ EventBubble.qml 2015-01-10 09:35:50 +0000
@@ -36,7 +36,7 @@
36 property Flickable flickable;36 property Flickable flickable;
3737
38 readonly property int minimumHeight: type == wideType38 readonly property int minimumHeight: type == wideType
39 ? eventDetails.item.timeLabelHeight + /*top-bottom margin*/ units.gu(2)39 ? detailsItems.timeLabelHeight + /*top-bottom margin*/ units.gu(2)
40 : units.gu(2)40 : units.gu(2)
4141
42 z: depthInRow42 z: depthInRow
@@ -65,6 +65,7 @@
65 onEventChanged: {65 onEventChanged: {
66 resize();66 resize();
67 assingnBgColor();67 assingnBgColor();
68 setDetails();
68 }69 }
6970
70 function assingnBgColor() {71 function assingnBgColor() {
@@ -106,128 +107,106 @@
106107
107 if( infoBubble.y < flickable.contentY && infoBubble.height > flickable.height) {108 if( infoBubble.y < flickable.contentY && infoBubble.height > flickable.height) {
108 var y = (flickable.contentY - infoBubble.y) * 1.2;109 var y = (flickable.contentY - infoBubble.y) * 1.2;
109 if( ( y + eventDetails.item.height + units.gu(2)) > infoBubble.height) {110 if( ( y + detailsItems.height + units.gu(2)) > infoBubble.height) {
110 y = infoBubble.height - eventDetails.item.height - units.gu(2);111 y = infoBubble.height - detailsItems.height - units.gu(2);
111 }112 }
112 eventDetails.item.y = y;113 detailsItems.y = y;
113 }114 }
114 }115 }
115116
116 Loader {117 function setDetails() {
117 id:eventDetails118 if(event === null || event === undefined) {
118 sourceComponent: type == wideType ? detailsComponent : undefined119 return;
119 }120 }
120121
121 Component {122 var startTime = Qt.formatTime( event.startDateTime, "hh:mm")
122 id:detailsComponent123 var endTime = Qt.formatTime( event.endDateTime, "hh:mm")
123124
124 Item {125 if (type === wideType) {
125126 timeLabel.text = ""
126 id: detailsItems127 titleLabel.text = ""
127 property alias timeLabelHeight : timeLabel.height128
128129 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
129 width: parent.width130 // while the second one (%2) refers to the end time
130 height: detailsColumn.height131 var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
131132
132 Column {133 //height is less then set only event title
133 id: detailsColumn134 if( infoBubble.height > minimumHeight ) {
134135 //on wide type show all details
135 anchors {136 if( infoBubble.height > titleLabel.y + titleLabel.height + units.gu(1)) {
136 top: parent.top137 timeLabel.text = timeString
137 left: parent.left138 titleLabel.text = "<b>" + event.displayLabel +"</b>"
138 right: parent.right139 } else if ( event.displayLabel ) {
139 margins: units.gu(0.5)140 // TRANSLATORS: the first argument (%1) refers to a time for an event,
140 }141 // while the second one (%2) refers to title of event
141142 timeLabel.text = i18n.tr("%1 <b>%2</b>").arg(timeString).arg(event.displayLabel);
142 Label {143 }
143 id: timeLabel144 } else if (event.displayLabel){
144 objectName: "timeLabel"145 // TRANSLATORS: the first argument (%1) refers to a time for an event,
145 color: "White"146 // while the second one (%2) refers to title of event
146 fontSize:"small"147 timeLabel.text = i18n.tr("%1 <b>%2</b>").arg(timeString).arg(event.displayLabel);
147 font.bold: true148 }
148 width: parent.width149 } else {
149 }150 timeLabel.text = event.displayLabel;
150151 timeLabel.horizontalAlignment = Text.AlignHCenter
151 Label {152 timeLabel.wrapMode = Text.WrapAtWordBoundaryOrAnywhere
152 id: titleLabel153 }
153 objectName: "titleLabel"154
154 color: "White"155 layoutBubbleDetails();
155 fontSize: "small"156 }
156 width: parent.width157
157 wrapMode: Text.WrapAtWordBoundaryOrAnywhere158 Item {
158 }159 id: detailsItems
159160
160 Label {161 property alias timeLabelHeight : timeLabel.height
161 id: descriptionLabel162
162 color: "White"163 width: parent.width
163 fontSize: "x-small"164 height: detailsColumn.height
164 width: parent.width165
166 Column {
167 id: detailsColumn
168
169 anchors {
170 top: parent.top
171 left: parent.left
172 right: parent.right
173 margins: units.gu(0.5)
174 }
175
176 Label {
177 id: timeLabel
178 objectName: "timeLabel"
179 color: "White"
180 fontSize:"small"
181 font.bold: true
182 width: parent.width
183 }
184
185 Label {
186 id: titleLabel
187 objectName: "titleLabel"
188 color: "White"
189 fontSize: "small"
190 width: parent.width
191 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
192 }
193 }
194
195 onHeightChanged: {
196 layoutBubbleDetails();
197 }
198
199 Connections {
200 target: infoBubble
201 onFlickableChanged: {
202 if (flickable && infoBubble.height > flickable.height) {
203 flickable.onContentYChanged.connect(layoutBubbleDetails);
165 }204 }
166 }205 }
167206
168 onHeightChanged: {207 onHeightChanged: {
169 layoutBubbleDetails();208 if(flickable && infoBubble.height > flickable.height) {
170 }209 flickable.onContentYChanged.connect(layoutBubbleDetails);
171
172 Connections {
173 target: infoBubble
174 onFlickableChanged: {
175 if (flickable && infoBubble.height > flickable.height) {
176 flickable.onContentYChanged.connect(layoutBubbleDetails);
177 }
178 }
179
180 onHeightChanged: {
181 if(flickable && infoBubble.height > flickable.height) {
182 flickable.onContentYChanged.connect(layoutBubbleDetails);
183 }
184 }
185
186 onEventChanged: {
187 setDetails();
188 }
189 }
190
191 function setDetails() {
192 if(event === null || event === undefined) {
193 return;
194 }
195
196 var startTime = event.startDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
197 var endTime = event.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
198
199 if (type === wideType) {
200 timeLabel.text = ""
201 titleLabel.text = ""
202 descriptionLabel.text = ""
203 //height is less then set only event title
204 if( infoBubble.height > minimumHeight ) {
205 //on wide type show all details
206 if( infoBubble.height > titleLabel.y + titleLabel.height + units.gu(1)) {
207 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
208 // while the second one (%2) refers to the end time
209 var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
210 timeLabel.text = timeString
211 titleLabel.text = event.displayLabel
212 } else if ( event.displayLabel ) {
213 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
214 // while the second one (%2) refers to title of event
215 timeLabel.text = i18n.tr("%1 - %2").arg(startTime).arg(event.displayLabel);
216 }
217
218 if (event.description) {
219 descriptionLabel.text = event.description
220 //descriptionText = event.description
221 //If content is too much don't display.
222 if (infoBubble.height < descriptionLabel.y + descriptionLabel.height + units.gu(1)) {
223 descriptionLabel.text = ""
224 }
225 }
226
227 layoutBubbleDetails();
228 } else if (event.displayLabel){
229 timeLabel.text = event.displayLabel;
230 }
231 }210 }
232 }211 }
233 }212 }
234213
=== modified file 'tests/autopilot/calendar_app/__init__.py'
--- tests/autopilot/calendar_app/__init__.py 2014-11-29 10:04:12 +0000
+++ tests/autopilot/calendar_app/__init__.py 2015-01-10 09:35:50 +0000
@@ -399,7 +399,8 @@
399399
400 for event in event_bubbles:400 for event in event_bubbles:
401 # Event-bubbles objects are recycled, only show visible ones.401 # Event-bubbles objects are recycled, only show visible ones.
402 if event.get_name() == event_name:402 temp = "<b>"+event_name+"</b>"
403 if event.get_name() == temp:
403 if (visible and event.visible) or not visible:404 if (visible and event.visible) or not visible:
404 matched_event = event405 matched_event = event
405 return matched_event406 return matched_event

Subscribers

People subscribed via source and target branches

to status/vote changes: