~ryan-olson-x/ubuntu-calendar-app/goToToday

« back to all changes in this revision

Viewing changes to calendar.qml

  • Committer: Frank Mertens
  • Date: 2013-02-14 18:03:27 UTC
  • Revision ID: frank@cyblogic.de-20130214180327-1dniqip7ig2znai2
Initial code for the month view. Also bootstrapped a small extension library for JS::Date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
MainView {
11
11
    // objectName for functional testing purposes (autopilot-qt5)
12
12
    objectName: "calendar"
13
 
    
14
 
    width: units.gu(50)
15
 
    height: units.gu(75)
16
 
    
 
13
 
 
14
    id: mainView
 
15
    width: units.gu(45)
 
16
    height: units.gu(80)
 
17
        // FIXME: 80/45 = aspect ration of galaxy nexus
 
18
 
17
19
    Tabs {
18
20
        id: tabs
19
21
        anchors.fill: parent
20
 
        
 
22
 
21
23
        // First tab begins here
22
24
        Tab {
23
25
            objectName: "Tab1"
24
 
            
 
26
 
25
27
            title: i18n.tr("Calendar")
26
 
            
 
28
 
27
29
            // Tab content begins here
28
30
            page: Page {
29
 
                Column {
30
 
                    anchors.centerIn: parent
31
 
                    Label {
32
 
                        text: i18n.tr("Swipe from right to left to change tab.")
33
 
                    }
 
31
                MonthView {
 
32
                    width: mainView.width
 
33
                    height: mainView.height
 
34
                    // anchors.fill: parent // FIXME: delivers broken geometry on startup
34
35
                }
35
36
            }
36
37
        }
37
 
        
 
38
 
38
39
        // Second tab begins here
39
40
        Tab {
40
41
            objectName: "Tab2"
41
 
            
 
42
 
42
43
            title: i18n.tr("Optional Screen")
43
44
            page: Page {
44
45
                anchors.margins: units.gu(2)
45
 
                
 
46
 
46
47
                tools: ToolbarActions {
47
48
                    Action {
48
49
                        objectName: "action"
49
 
                        
 
50
 
50
51
                        iconSource: Qt.resolvedUrl("avatar.png")
51
52
                        text: i18n.tr("Tap me!")
52
 
                        
 
53
 
53
54
                        onTriggered: {
54
55
                            label.text = i18n.tr("Toolbar tapped")
55
56
                        }
56
57
                    }
57
58
                }
58
 
                
 
59
 
59
60
                Column {
60
61
                    anchors.centerIn: parent
61
62
                    Label {
62
63
                        id: label
63
64
                        objectName: "label"
64
 
                        
 
65
 
65
66
                        text: i18n.tr("Swipe from bottom to up to reveal the toolbar.")
66
67
                    }
67
68
                }