~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes

« back to all changes in this revision

Viewing changes to tests/resources/navigation/TabView.qml

  • Committer: Christian Dywan
  • Date: 2014-04-30 10:22:44 UTC
  • mfrom: (1000.17.3 staging)
  • mto: (1000.41.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: christian.dywan@canonical.com-20140430102244-uti97msd0thmk31d
MergeĀ lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 */
16
16
 
17
17
import QtQuick 2.0
18
 
import Ubuntu.Components 0.1
 
18
import Ubuntu.Components 1.1
19
19
 
20
20
 
21
21
MainView {
25
25
 
26
26
    ListModel {
27
27
        id: pages
 
28
        property int selectedIndex: 0
28
29
        ListElement {
29
30
            title: "Tab 1"
30
31
        }
44
45
 
45
46
    Header {
46
47
        id: header
47
 
        contents: TabBar {
48
 
            id: tabBar
49
 
            model: pages
50
 
            anchors {
51
 
                top: parent.top
52
 
                left: parent.left
53
 
                right: parent.right
54
 
            }
55
 
        }
 
48
        tabsModel: pages
56
49
    }
57
50
 
58
51
    Component {
68
61
            color: Qt.rgba(Math.random(0.5), Math.random(1), Math.random(0.5), 1)
69
62
            MouseArea {
70
63
                anchors.fill: parent
71
 
                onClicked: tabBar.selectedIndex = index
 
64
                onClicked: pages.selectedIndex = index
72
65
            }
73
66
        }
74
67
    }
83
76
        orientation: Qt.Horizontal
84
77
        model: pages
85
78
        delegate: tabComponent
86
 
        currentIndex: tabBar.selectedIndex
 
79
        currentIndex: pages.selectedIndex
87
80
    }
88
81
}