~renatofilho/ubuntu-calendar-app/optimize

« back to all changes in this revision

Viewing changes to WeekView.qml

  • Committer: Renato Araujo Oliveira Filho
  • Date: 2016-02-24 12:18:36 UTC
  • Revision ID: renato.filho@canonical.com-20160224121836-nsloqtpojjgr90es
Make sure that week view is scrolled to current time when app is opened.
Fix 'today' action to correct scroll to current date on week view.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
        iconName: "calendar-today"
56
56
        text: i18n.tr("Today")
57
57
        onTriggered: {
 
58
            anchorDate = new Date()
58
59
            weekViewPath.scrollToBegginer()
59
 
            anchorDate = new Date()
 
60
            idleScroll.restart()
 
61
        }
 
62
    }
 
63
 
 
64
    Timer {
 
65
        id: idleScroll
 
66
 
 
67
        interval: 200
 
68
        repeat:false
 
69
        onTriggered: {
 
70
            weekViewPath.currentItem.item.scrollToCurrentTime();
 
71
            weekViewPath.currentItem.item.scrollTocurrentDate();
60
72
        }
61
73
    }
62
74
 
135
147
                    Component.onCompleted: {
136
148
                        var iType = weekViewPath.indexType(index)
137
149
                        if (iType === 0) {
138
 
                            scrollToCurrentTime();
139
 
                            scrollTocurrentDate();
 
150
                            idleScroll.restart()
140
151
                        } else if (iType < 0) {
141
152
                            scrollToEnd()
142
153
                        }