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

Proposed by Kunal Parmar
Status: Merged
Approved by: Mihir Soni
Approved revision: 512
Merged at revision: 514
Proposed branch: lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Truncation
Merge into: lp:ubuntu-calendar-app
Diff against target: 135 lines (+49/-48)
1 file modified
EventBubble.qml (+49/-48)
To merge this branch: bzr merge lp:~pkunal-parmar/ubuntu-calendar-app/EventBubble-Truncation
Reviewer Review Type Date Requested Status
Mihir Soni Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+238983@code.launchpad.net

Commit message

Resolves Bug #1371869
Event bubbles: do not cut off text vertically

Description of the change

Resolves Bug #1371869
Event bubbles: do not cut off text vertically

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: Approve (continuous-integration)
Revision history for this message
Mihir Soni (mihirsoni) wrote :

Looks good to me.
Thanks Kunal.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'EventBubble.qml'
--- EventBubble.qml 2014-10-20 14:41:19 +0000
+++ EventBubble.qml 2014-10-20 21:39:22 +0000
@@ -61,51 +61,7 @@
6161
62 onEventChanged: {62 onEventChanged: {
63 resize();63 resize();
64 setDetails();64 if (model && event ) {
65 }
66
67 Component.onCompleted: {
68 setDetails();
69 }
70
71 function setDetails() {
72 if(event === null || event === undefined) {
73 return;
74 }
75
76 var startTime = event.startDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
77 var endTime = event.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
78
79 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
80 // while the second one (%2) refers to the end time
81 var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
82
83 if (type === wideType) {
84 eventDetails.item.timeLableText= ""
85 eventDetails.item.titleLabelText = ""
86 eventDetails.item.descriptionText.text = ""
87 //height is less then set only event title
88 if( height > minimumHeight ) {
89 //on wide type show all details
90 eventDetails.item.timeLableText = timeString
91 if (event.displayLabel)
92 eventDetails.item.titleLabelText = event.displayLabel;
93 if (event.description)
94 {
95 eventDetails.item.descriptionText= event.description
96 //If content is too much don't display.
97 if (height < descriptionLabel.height + descriptionLabel.y) {
98 eventDetails.item.descriptionText.text = ""
99 }
100 }
101 layoutBubbleDetails();
102
103 } else {
104 if (event.displayLabel)
105 eventDetails.item.timeLableText = event.displayLabel;
106 }
107 }
108 if (model) {
109 var collection = model.collection( event.collectionId );65 var collection = model.collection( event.collectionId );
110 bg.color = collection.color66 bg.color = collection.color
111 }67 }
@@ -151,7 +107,7 @@
151 top: parent.top107 top: parent.top
152 left: parent.left108 left: parent.left
153 right: parent.right109 right: parent.right
154 margins: units.gu(1)110 margins: units.gu(0.5)
155 }111 }
156112
157 Label {113 Label {
@@ -161,7 +117,6 @@
161 fontSize:"small"117 fontSize:"small"
162 font.bold: true118 font.bold: true
163 width: parent.width119 width: parent.width
164
165 }120 }
166121
167 Label {122 Label {
@@ -178,7 +133,6 @@
178 color: "White"133 color: "White"
179 fontSize: "x-small"134 fontSize: "x-small"
180 width: parent.width135 width: parent.width
181 visible: type == wideType
182 }136 }
183 }137 }
184138
@@ -199,6 +153,53 @@
199 flickable.onContentYChanged.connect(layoutBubbleDetails);153 flickable.onContentYChanged.connect(layoutBubbleDetails);
200 }154 }
201 }155 }
156
157 onEventChanged: {
158 setDetails();
159 }
160 }
161
162 function setDetails() {
163 if(event === null || event === undefined) {
164 return;
165 }
166
167 var startTime = event.startDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
168 var endTime = event.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
169
170 if (type === wideType) {
171 timeLableText= ""
172 titleLabelText = ""
173 descriptionText.text = ""
174 //height is less then set only event title
175 if( infoBubble.height > minimumHeight ) {
176 //on wide type show all details
177 if( infoBubble.height > titleLabel.y + titleLabel.height + units.gu(1)) {
178 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
179 // while the second one (%2) refers to the end time
180 var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
181 timeLableText = timeString
182 titleLabelText = event.displayLabel
183 } else if ( event.displayLabel ) {
184 // TRANSLATORS: the first argument (%1) refers to a start time for an event,
185 // while the second one (%2) refers to title of event
186 timeLableText = i18n.tr("%1 - %2").arg(startTime).arg(event.displayLabel);
187 }
188
189 if (event.description) {
190 descriptionText = event.description
191 //descriptionText = event.description
192 //If content is too much don't display.
193 if (infoBubble.height < descriptionLabel.y + descriptionLabel.height + units.gu(1)) {
194 descriptionText = ""
195 }
196 }
197
198 layoutBubbleDetails();
199 } else if (event.displayLabel){
200 eventDetails.item.timeLableText = event.displayLabel;
201 }
202 }
202 }203 }
203 }204 }
204 }205 }

Subscribers

People subscribed via source and target branches

to status/vote changes: