~mihirsoni/ubuntu-calendar-app/bottomEdge

« back to all changes in this revision

Viewing changes to MonthComponentDateDelegate.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2014-11-11 12:42:34 UTC
  • mfrom: (535.3.1 ubuntu-calendar-app)
  • Revision ID: tarmac-20141111124234-1k7kg72pq60im3i1
Minor performance improvement for Month View.

Approved by Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    property bool isCurrentMonth;
9
9
    property bool isToday;
10
10
    property bool showEvent;
 
11
    property alias fontSize: dateLabel.font.pixelSize
11
12
 
12
13
    Loader {
13
 
        width: parent.width < parent.height ? parent.width : parent.height
14
 
        height: width
15
 
        anchors.centerIn: columns
16
14
        sourceComponent: isToday && isCurrentMonth ? highLightComp : undefined
 
15
        onSourceComponentChanged: {
 
16
            width =  Qt.binding( function() { return parent.width < parent.height ? parent.width : parent.height } );
 
17
            height = Qt.binding ( function() { return width} );
 
18
            anchors.centerIn = Qt.binding( function() { return parent});
 
19
        }
17
20
    }
18
21
 
19
22
    Column {
24
27
        Label {
25
28
            id: dateLabel
26
29
            text: date
27
 
            //horizontalAlignment: Text.AlignHCenter
28
30
            anchors.horizontalCenter: parent.horizontalCenter
29
31
            fontSize: root.dateLabelFontSize
30
32
            color: {
41
43
        }
42
44
 
43
45
        Loader{
44
 
            width: units.gu(1)
45
 
            height: width
46
46
            sourceComponent: showEvent ? eventIndicatorComp : undefined
47
 
            anchors.horizontalCenter: dateLabel.horizontalCenter
 
47
            onSourceComponentChanged: {
 
48
                width = Qt.binding( function() { return units.gu(1) } );
 
49
                height = Qt.binding( function() { return width } );
 
50
                anchors.horizontalCenter =  Qt.binding( function () { return parent.horizontalCenter } );
 
51
            }
48
52
        }
49
53
    }
50
54