~mihirsoni/ubuntu-calendar-app/dateSelectNewEventTest

« back to all changes in this revision

Viewing changes to EventBubble.qml

  • Committer: Tarmac
  • Author(s): Kunal Parmar
  • Date: 2014-10-22 13:49:45 UTC
  • mfrom: (512.1.5 ubuntu-calendar-app)
  • Revision ID: tarmac-20141022134945-xdgmo2tgxcihifbn
Bug #1371153
Distinguish past events from future events. Fixes: https://bugs.launchpad.net/bugs/1371153, https://bugs.launchpad.net/bugs/1371871.

Approved by Mihir Soni, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import QtQuick 2.3
20
20
import Ubuntu.Components 1.1
21
 
 
 
21
import QtOrganizer 5.0
22
22
 
23
23
Item{
24
24
    id: infoBubble
61
61
 
62
62
    onEventChanged: {
63
63
        resize();
 
64
        assingnBgColor();
 
65
    }
 
66
 
 
67
    function assingnBgColor() {
64
68
        if (model && event ) {
65
69
            var collection = model.collection( event.collectionId );
66
 
            bg.color = collection.color
 
70
            var now = new Date();
 
71
            if( event.endDateTime >= now) {
 
72
                bg.color = collection.color
 
73
            } else {
 
74
                //if event is on past then add some white color to original color
 
75
                bg.color = Qt.tint( collection.color, "#aaffffff" );
 
76
                return;
 
77
            }
67
78
        }
68
79
    }
69
80