~pkunal-parmar/ubuntu-calendar-app/Minor-Performance

« back to all changes in this revision

Viewing changes to EventBubble.qml

  • Committer: Yohan Boniface
  • Date: 2014-03-29 10:17:49 UTC
  • mfrom: (222 trunk)
  • mto: (197.1.14 DatePicker)
  • mto: This revision was merged to the branch mainline in revision 302.
  • Revision ID: yohanboniface@free.fr-20140329101749-8u68xnez64rri2f9
Merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
    property int wideType: 1;
11
11
    property int narrowType: 2;
12
12
 
 
13
    property Flickable flickable;
 
14
 
13
15
    readonly property int minimumHeight: timeLabel.height
14
16
 
15
17
    signal clicked(var event);
68
70
            if( event.displayLabel)
69
71
                timeLabel.text = event.displayLabel;
70
72
        }
 
73
 
 
74
        layoutBubbleDetails();
 
75
    }
 
76
 
 
77
    function layoutBubbleDetails() {
 
78
        if(!flickable || flickable === undefined ) {
 
79
            return;
 
80
        }
 
81
 
 
82
        if( infoBubble.y < flickable.contentY && infoBubble.height > flickable.height) {
 
83
            var y = (flickable.contentY - infoBubble.y) * 1.2;
 
84
            if( (y+ detailsColumn.height) > infoBubble.height) {
 
85
                y = infoBubble.height - detailsColumn.height;
 
86
            }
 
87
            detailsColumn.y = y;
 
88
        }
 
89
    }
 
90
 
 
91
    Connections{
 
92
        target: flickable
 
93
        onContentYChanged: {
 
94
            layoutBubbleDetails();
 
95
        }
 
96
    }
 
97
    Connections{
 
98
        target: detailsColumn
 
99
        onHeightChanged: {
 
100
            layoutBubbleDetails();
 
101
        }
71
102
    }
72
103
 
73
104
    Column{
 
105
        id: detailsColumn
74
106
        width: parent.width
 
107
 
75
108
        Row{
76
109
            width: parent.width
77
110