~ci-train-bot/ubuntu-filemanager-app/ubuntu-filemanager-app-ubuntu-zesty-2562

« back to all changes in this revision

Viewing changes to appTemplate.qml

  • Committer: Michael Hall
  • Date: 2013-02-12 16:18:48 UTC
  • Revision ID: mhall119@ubuntu.com-20130212161848-u5qt45e38jovrbyk
Initial code template

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
/*!
 
5
    \brief MainView with Tabs element.
 
6
           First Tab has a single Label and
 
7
           second Tab has a single ToolbarAction.
 
8
*/
 
9
 
 
10
MainView {
 
11
    // objectName for functional testing purposes (autopilot-qt5)
 
12
    objectName: "appTemplate"
 
13
    
 
14
    width: units.gu(50)
 
15
    height: units.gu(75)
 
16
    
 
17
    Tabs {
 
18
        id: tabs
 
19
        anchors.fill: parent
 
20
        
 
21
        // First tab begins here
 
22
        Tab {
 
23
            objectName: "Tab1"
 
24
            
 
25
            title: i18n.tr("AppTemplate")
 
26
            
 
27
            // Tab content begins here
 
28
            page: Page {
 
29
                Column {
 
30
                    anchors.centerIn: parent
 
31
                    Label {
 
32
                        text: i18n.tr("Swipe from right to left to change tab.")
 
33
                    }
 
34
                }
 
35
            }
 
36
        }
 
37
        
 
38
        // Second tab begins here
 
39
        Tab {
 
40
            objectName: "Tab2"
 
41
            
 
42
            title: i18n.tr("Optional Screen")
 
43
            page: Page {
 
44
                anchors.margins: units.gu(2)
 
45
                
 
46
                tools: ToolbarActions {
 
47
                    Action {
 
48
                        objectName: "action"
 
49
                        
 
50
                        iconSource: Qt.resolvedUrl("avatar.png")
 
51
                        text: i18n.tr("Tap me!")
 
52
                        
 
53
                        onTriggered: {
 
54
                            label.text = i18n.tr("Toolbar tapped")
 
55
                        }
 
56
                    }
 
57
                }
 
58
                
 
59
                Column {
 
60
                    anchors.centerIn: parent
 
61
                    Label {
 
62
                        id: label
 
63
                        objectName: "label"
 
64
                        
 
65
                        text: i18n.tr("Swipe from bottom to up to reveal the toolbar.")
 
66
                    }
 
67
                }
 
68
            }
 
69
        }
 
70
    }
 
71
}