~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2106

« back to all changes in this revision

Viewing changes to examples/SettingsComponents.qml

  • Committer: Marco Trevisan (Treviño)
  • Date: 2016-09-29 16:42:22 UTC
  • mto: (146.5.19 new-calendar-design)
  • mto: This revision was merged to the branch mainline in revision 169.
  • Revision ID: mail@3v1n0.net-20160929164222-bo863zxqyxfs45fd
examples: add a page action to switch between pointer and touch mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    width: units.gu(50)
30
30
    height: units.gu(100)
31
31
 
 
32
    property bool pointerMode: true
 
33
 
32
34
    Component.onCompleted: {
33
35
        theme.name = "Ubuntu.Components.Themes.SuruDark"
34
36
    }
45
47
        header: PageHeader {
46
48
            id: header
47
49
            title: listView.currentItem ? listView.currentItem.item.title : "Components"
 
50
 
 
51
            leadingActionBar.actions: [
 
52
                Action {
 
53
                    iconName: mainView.pointerMode ? "input-mouse-symbolic" : "input-touchpad-symbolic"
 
54
                    text: mainView.pointerMode ? "Pointer mode" : "Touch mode"
 
55
                    onTriggered: mainView.pointerMode = !mainView.pointerMode
 
56
                }
 
57
            ]
48
58
        }
49
59
 
50
60
        clip: true
65
75
                height: ListView.view.height
66
76
 
67
77
                source: model.source
 
78
                onStatusChanged: {
 
79
                    if (status == Loader.Ready) {
 
80
                        item.pointerMode = Qt.binding(function() { return mainView.pointerMode })
 
81
                    }
 
82
                }
68
83
            }
69
84
        }
70
85
    }