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
1=== modified file 'EventBubble.qml'
2--- EventBubble.qml 2014-10-20 14:41:19 +0000
3+++ EventBubble.qml 2014-10-20 21:39:22 +0000
4@@ -61,51 +61,7 @@
5
6 onEventChanged: {
7 resize();
8- setDetails();
9- }
10-
11- Component.onCompleted: {
12- setDetails();
13- }
14-
15- function setDetails() {
16- if(event === null || event === undefined) {
17- return;
18- }
19-
20- var startTime = event.startDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
21- var endTime = event.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
22-
23- // TRANSLATORS: the first argument (%1) refers to a start time for an event,
24- // while the second one (%2) refers to the end time
25- var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
26-
27- if (type === wideType) {
28- eventDetails.item.timeLableText= ""
29- eventDetails.item.titleLabelText = ""
30- eventDetails.item.descriptionText.text = ""
31- //height is less then set only event title
32- if( height > minimumHeight ) {
33- //on wide type show all details
34- eventDetails.item.timeLableText = timeString
35- if (event.displayLabel)
36- eventDetails.item.titleLabelText = event.displayLabel;
37- if (event.description)
38- {
39- eventDetails.item.descriptionText= event.description
40- //If content is too much don't display.
41- if (height < descriptionLabel.height + descriptionLabel.y) {
42- eventDetails.item.descriptionText.text = ""
43- }
44- }
45- layoutBubbleDetails();
46-
47- } else {
48- if (event.displayLabel)
49- eventDetails.item.timeLableText = event.displayLabel;
50- }
51- }
52- if (model) {
53+ if (model && event ) {
54 var collection = model.collection( event.collectionId );
55 bg.color = collection.color
56 }
57@@ -151,7 +107,7 @@
58 top: parent.top
59 left: parent.left
60 right: parent.right
61- margins: units.gu(1)
62+ margins: units.gu(0.5)
63 }
64
65 Label {
66@@ -161,7 +117,6 @@
67 fontSize:"small"
68 font.bold: true
69 width: parent.width
70-
71 }
72
73 Label {
74@@ -178,7 +133,6 @@
75 color: "White"
76 fontSize: "x-small"
77 width: parent.width
78- visible: type == wideType
79 }
80 }
81
82@@ -199,6 +153,53 @@
83 flickable.onContentYChanged.connect(layoutBubbleDetails);
84 }
85 }
86+
87+ onEventChanged: {
88+ setDetails();
89+ }
90+ }
91+
92+ function setDetails() {
93+ if(event === null || event === undefined) {
94+ return;
95+ }
96+
97+ var startTime = event.startDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
98+ var endTime = event.endDateTime.toLocaleTimeString(Qt.locale(), Locale.ShortFormat)
99+
100+ if (type === wideType) {
101+ timeLableText= ""
102+ titleLabelText = ""
103+ descriptionText.text = ""
104+ //height is less then set only event title
105+ if( infoBubble.height > minimumHeight ) {
106+ //on wide type show all details
107+ if( infoBubble.height > titleLabel.y + titleLabel.height + units.gu(1)) {
108+ // TRANSLATORS: the first argument (%1) refers to a start time for an event,
109+ // while the second one (%2) refers to the end time
110+ var timeString = i18n.tr("%1 - %2").arg(startTime).arg(endTime)
111+ timeLableText = timeString
112+ titleLabelText = event.displayLabel
113+ } else if ( event.displayLabel ) {
114+ // TRANSLATORS: the first argument (%1) refers to a start time for an event,
115+ // while the second one (%2) refers to title of event
116+ timeLableText = i18n.tr("%1 - %2").arg(startTime).arg(event.displayLabel);
117+ }
118+
119+ if (event.description) {
120+ descriptionText = event.description
121+ //descriptionText = event.description
122+ //If content is too much don't display.
123+ if (infoBubble.height < descriptionLabel.y + descriptionLabel.height + units.gu(1)) {
124+ descriptionText = ""
125+ }
126+ }
127+
128+ layoutBubbleDetails();
129+ } else if (event.displayLabel){
130+ eventDetails.item.timeLableText = event.displayLabel;
131+ }
132+ }
133 }
134 }
135 }

Subscribers

People subscribed via source and target branches

to status/vote changes: