~pkunal-parmar/ubuntu-calendar-app/ICalImport

« back to all changes in this revision

Viewing changes to EventViewBase.qml

  • Committer: Launchpad Translations on behalf of ubuntu-calendar-dev
  • Date: 2013-09-27 06:18:03 UTC
  • Revision ID: launchpad_translations_on_behalf_of_ubuntu-calendar-dev-20130927061803-e9flhovkpqcoxq2b
Launchpad automatic translations update.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import QtQuick 2.0
2
 
import Ubuntu.Components 0.1
3
 
 
4
 
import "dateExt.js" as DateExt
5
 
import "colorUtils.js" as Color
6
 
 
7
 
Item {
8
 
    id: baseView
9
 
 
10
 
    property var dayStart: new Date()
11
 
    property alias eventModel: model;
12
 
    property Flickable flickableChild;
13
 
 
14
 
    state: "COMPRESSED"
15
 
 
16
 
    signal newEvent()
17
 
    signal modelRefreshed();
18
 
 
19
 
    clip: true
20
 
 
21
 
    EventListModel {
22
 
        id: model
23
 
        termStart: dayStart
24
 
        termLength: Date.msPerDay
25
 
 
26
 
        onReload: {
27
 
            modelRefreshed();
28
 
        }
29
 
    }
30
 
 
31
 
    Connections{
32
 
        target: flickableChild
33
 
 
34
 
        onContentYChanged: {
35
 
            if (state == "COMPRESSING" || state == "EXPANDING" || !flickableChild.dragging ) return
36
 
 
37
 
            if ( state == "EXPANDED" && flickableChild.contentY < -units.gu(0.5) ) {
38
 
                state = "COMPRESSING";
39
 
            }
40
 
            else if (flickableChild.contentY < -units.gu(0.5)) {
41
 
                state = "EXPANDING";
42
 
            }
43
 
        }
44
 
 
45
 
        onDraggingChanged: {
46
 
            if (flickableChild.dragging) return;
47
 
 
48
 
            if( state == "EXPANDING" ) {
49
 
                state = "EXPANDED";
50
 
            } else if ( state == "COMPRESSING") {
51
 
                state = "COMPRESSED";
52
 
            }
53
 
        }
54
 
    }
55
 
 
56
 
    states: [
57
 
            State {
58
 
                name: "EXPANDING"
59
 
            },
60
 
            State {
61
 
                name: "COMPRESSING"
62
 
            },
63
 
            State {
64
 
                name: "EXPANDED"
65
 
            },
66
 
            State {
67
 
                name: "COMPRESSED"
68
 
            }
69
 
        ]
70
 
}