Merge lp:~mihirsoni/ubuntu-calendar-app/1308001 into lp:ubuntu-calendar-app

Proposed by Mihir Soni
Status: Merged
Approved by: Kunal Parmar
Approved revision: 269
Merged at revision: 268
Proposed branch: lp:~mihirsoni/ubuntu-calendar-app/1308001
Merge into: lp:ubuntu-calendar-app
Diff against target: 79 lines (+19/-14)
1 file modified
EventBubble.qml (+19/-14)
To merge this branch: bzr merge lp:~mihirsoni/ubuntu-calendar-app/1308001
Reviewer Review Type Date Requested Status
Kunal Parmar Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
David Planella Needs Fixing
Review via email: mp+217683@code.launchpad.net

Commit message

Event bubble height issue

Description of the change

Bug #1308001
Event bubble height issues.

To post a comment you must log in.
Revision history for this message
Mihir Soni (mihirsoni) wrote :

It looks like :- http://imgur.com/yhzbElj

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
Kunal Parmar (pkunal-parmar) wrote :

We need to apply margin on top and bottom as well. From image it looks like its missing

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

+ x:units.gu(1)

Please use anchors for alighments

review: Needs Fixing
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

64 + property int hourHeight: units.gu(12)

why we are changing the hourHeight ?

And if you change here I believe there are other place as well where we need to make changes related to this.

review: Needs Information
Revision history for this message
Mihir Soni (mihirsoni) wrote :

> 64 + property int hourHeight: units.gu(12)
>
> why we are changing the hourHeight ?
>
> And if you change here I believe there are other place as well where we need
> to make changes related to this.

Hi Kunal,It is being used to define the minimum height of the bubble. if you see the rest of the code where hourHeight is being used.

There is no other impact as far as I tested.

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Comparing this merge with the design image from dpm in the linked bug.

This merge: https://imgur.com/fYWwYCn
Design from dpm: https://launchpadlibrarian.net/172944464/calendar_item.jpg

* The dot is too close to the edge
* There's insufficient border around the text
* The location is displayed

review: Needs Fixing
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> > 64 + property int hourHeight: units.gu(12)
> >
> > why we are changing the hourHeight ?
> >
> > And if you change here I believe there are other place as well where we need
> > to make changes related to this.
>
> Hi Kunal,It is being used to define the minimum height of the bubble. if you
> see the rest of the code where hourHeight is being used.
>
> There is no other impact as far as I tested.

hourHeight is height of strip. Not event bubble.

Event bubble height is decided by following logic

 var durationMin = (event.endDateTime.getHours() - event.startDateTime.getHours()) * 60;
        durationMin += (event.endDateTime.getMinutes() - event.startDateTime.getMinutes());
        var height = (durationMin * hourHeight )/ 60;
        eventBubble.height = (height > eventBubble.minimumHeight) ? height:eventBubble.minimumHeight ;

review: Needs Fixing
Revision history for this message
Mihir Soni (mihirsoni) wrote :

This is how it looks like now,
http://imgur.com/iz0T5SP

Kunal, i have reverted the changes in Timelinebase.qml file.

Would appreciate your feedback.

259. By Mihir Soni

Description will be visible only if is fit to event bubble

260. By Mihir Soni

Resolved typo in color

Revision history for this message
David Planella (dpm) wrote :

Mihir, great work on that! One thing I've noticed is that the dot should have the same spacing to the top and to the right edges as the text. Now it seems that the dot is closer to the edges than the text

review: Needs Fixing
261. By Mihir Soni

Same margin as text

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Still seems *slightly* off.

https://imgur.com/DvPadti

Doesn't look uniformly distant from top and right edge of event bubble?

review: Needs Fixing
262. By Mihir Soni

slight margin issues

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
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :
review: Approve
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

9 + if( event.description && descriptionLabel.height > height) //If content is too much don't display.
10 descriptionLabel.text = event.description

Can you explain the logic, why description should be set only when description label's height is grater then height of bubble ?

review: Needs Information
Revision history for this message
Mihir Soni (mihirsoni) wrote :

> 9 + if( event.description && descriptionLabel.height >
> height) //If content is too much don't display.
> 10 descriptionLabel.text = event.description
>
> Can you explain the logic, why description should be set only when description
> label's height is grater then height of bubble ?

Hi kunal,

it was suggested by David , you can find it in description of bug #1308001

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> > 9 + if( event.description && descriptionLabel.height >
> > height) //If content is too much don't display.
> > 10 descriptionLabel.text = event.description
> >
> > Can you explain the logic, why description should be set only when
> description
> > label's height is grater then height of bubble ?
>
> Hi kunal,
>
> it was suggested by David , you can find it in description of bug #1308001

Yes but, in that case height of description should be less then height of bubble. And not otherwise.

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Kunal like this ?

if (event.description && height > descriptionLabel.height)

Revision history for this message
Mihir Soni (mihirsoni) wrote :

> > > 9 + if( event.description && descriptionLabel.height
> >
> > > height) //If content is too much don't display.
> > > 10 descriptionLabel.text = event.description
> > >
> > > Can you explain the logic, why description should be set only when
> > description
> > > label's height is grater then height of bubble ?
> >
> > Hi kunal,
> >
> > it was suggested by David , you can find it in description of bug #1308001
>
> Yes but, in that case height of description should be less then height of
> bubble. And not otherwise.

If you try otherwise , it is showing event description if it is not able to fit in event bubble.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> > > > 9 + if( event.description &&
> descriptionLabel.height
> > >
> > > > height) //If content is too much don't display.
> > > > 10 descriptionLabel.text = event.description
> > > >
> > > > Can you explain the logic, why description should be set only when
> > > description
> > > > label's height is grater then height of bubble ?
> > >
> > > Hi kunal,
> > >
> > > it was suggested by David , you can find it in description of bug #1308001
> >
> > Yes but, in that case height of description should be less then height of
> > bubble. And not otherwise.
>
> If you try otherwise , it is showing event description if it is not able to
> fit in event bubble.

You will need to consider y position as well, just checking height will not help.

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Kunal,

sorry for more question , but i am misunderstanding your comment.

if( event.description && height > descriptionLabel.height && width < descriptionLabel.width)

I did try above statement and it gave me same output as before with no change.

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

> Hi Kunal,
>
> sorry for more question , but i am misunderstanding your comment.
>
> if( event.description && height > descriptionLabel.height && width <
> descriptionLabel.width)
>
> I did try above statement and it gave me same output as before with no change.
.
As far as I understand, you need to check descriptionLabel.y + descriptionLabel.height. and those should be less then height of bubble to make description visible.

Or you can check total height of column and compare that to height of bubble to decide if description label should be visible or not.

Revision history for this message
Mihir Soni (mihirsoni) wrote :

Hi Kunal,

I did try as you suggested but it is not working as expected like :

I have event with huge description , which shouldn't display but it is displaying if i use following condition

     if( event.description && descriptionLabel.y + descriptionLabel.height < height)

http://imgur.com/H4hrDd3

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

Pls print the values and see what vlaues are coming and check if those are same with what you expect.

263. By Mihir Soni

modfied the condition

264. By Mihir Soni

merge with trunk

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
Kunal Parmar (pkunal-parmar) wrote :

25 + Item{
26 id: detailsColumn
27 width: parent.width

I think we dont need this new Item, you can directly assign margin to column element.

review: Needs Fixing
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

31 + Column{
32 width: parent.width

You have put anchors.fill: parent, so we dont need to assign width, we can just remove above statement

review: Needs Fixing
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

45 + anchors.fill: parent
46 + anchors.topMargin: units.gu(0.5)
47 + anchors.leftMargin: units.gu(1)

Why topMargin and leftMargin is not similar ? For symmetry I would expect it to be same.

review: Needs Information
Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

46 + anchors.topMargin: units.gu(0.5)
47 + anchors.leftMargin: units.gu(1)

We can put rightMargin as well here and simplify below statement. (- units.gu(0.5) won't be necessary)

54 + color:"gray"
55 + width: parent.width - rect.width - units.gu(0.5)

review: Needs Fixing
265. By Mihir Soni

modification as per review comments

266. By Mihir Soni

Merge with trunk

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
Kunal Parmar (pkunal-parmar) wrote :

I meant something like this

http://pastebin.ubuntu.com/7415851/

267. By Mihir Soni

changes as per review comments

268. By Mihir Soni

Merge from trunk

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
Kunal Parmar (pkunal-parmar) wrote :

64 + anchors.bottom: parent.Bottom
65 +

Can you check if we need this ?

269. By Mihir Soni

Removed anchors

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
Kunal Parmar (pkunal-parmar) wrote :

looks good, thanks

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-03-26 14:29:37 +0000
3+++ EventBubble.qml 2014-05-09 07:52:55 +0000
4@@ -56,9 +56,14 @@
5
6 if( event.displayLabel)
7 titleLabel.text = event.displayLabel;
8-
9 if( event.description)
10+ {
11 descriptionLabel.text = event.description
12+ //If content is too much don't display.
13+ if( height < descriptionLabel.height + descriptionLabel.y){
14+ descriptionLabel.text = ""
15+ }
16+ }
17 } else {
18 //narrow type shows only time and title
19 timeLabel.text = startTime
20@@ -103,31 +108,31 @@
21
22 Column{
23 id: detailsColumn
24- width: parent.width
25+
26+ anchors.fill: parent
27+ anchors.topMargin: units.gu(1)
28+ anchors.leftMargin: units.gu(1)
29+ anchors.rightMargin: units.gu(1)
30
31 Row{
32 width: parent.width
33
34+ Label{
35+ id: timeLabel
36+ fontSize:"small";
37+ color:"gray"
38+ width: parent.width - rect.width
39+ }
40 Rectangle{
41+ id:rect
42 width: units.gu(1)
43 radius: width/2
44 height: width
45 color: "#715772"
46- anchors.verticalCenter: parent.verticalCenter
47- antialiasing: true
48- }
49-
50- Label{
51- id: timeLabel
52- fontSize:"small";
53- color:"gray"
54- width: parent.width
55 }
56 }
57-
58 Label{
59 id: titleLabel
60- x: units.gu(1)
61 fontSize:"small";
62 color:"black"
63 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
64@@ -136,7 +141,6 @@
65
66 Label{
67 id: descriptionLabel
68- x: units.gu(1)
69 fontSize:"small";
70 color:"gray"
71 wrapMode: Text.WrapAtWordBoundaryOrAnywhere
72@@ -145,6 +149,7 @@
73 }
74 }
75
76+
77 MouseArea{
78 anchors.fill: parent
79 onClicked: {

Subscribers

People subscribed via source and target branches

to status/vote changes: