~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-yakkety-1993

« back to all changes in this revision

Viewing changes to examples/OtherComponents.qml

  • Committer: Bileto Bot
  • Date: 2016-10-11 09:36:08 UTC
  • mfrom: (146.3.109 slots-layouts)
  • Revision ID: ci-train-bot@canonical.com-20161011093608-w2zqafz4tiqvh29q
* Menus: rewrite components using ListItemLayout's and SlotsLayout's
* Bump revision to 0.10, as per Components removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
Item {
25
25
    property string title: "Settings Components"
26
26
 
 
27
    width: parent && parent.width ? parent.width : units.gu(42)
 
28
    height: parent && parent.width ? parent.height : units.gu(75)
 
29
 
27
30
    ListModel {
28
31
        id: mediaPlayerModel
29
32
        ListElement { song: "You're The First, The Last, My Everything"; artist: "Barry White"; album: "Hot Soul"; albumArt: "artwork/beach.jpg"}
60
63
 
61
64
            StandardMenu {
62
65
                text: i18n.tr("Standard Menu\nLook at me, I'm a new line.")
63
 
            }
64
 
 
65
 
            StandardMenu {
66
 
                iconSource: "image://theme/calendar"
 
66
                onTriggered: console.log("Triggered")
 
67
            }
 
68
 
 
69
            StandardMenu {
 
70
                id: dividerToggleMenu
 
71
                text: i18n.tr("Toggle divider menu.")
 
72
                showDivider: false
 
73
 
 
74
                slots: [
 
75
                    Button {
 
76
                        text: dividerToggleMenu.showDivider ? i18n.tr("Hide") : i18n.tr("Show")
 
77
                        onClicked: dividerToggleMenu.showDivider = !dividerToggleMenu.showDivider
 
78
                    }
 
79
                ]
 
80
            }
 
81
 
 
82
            StandardMenu {
 
83
                text: i18n.tr("Removable menu.")
 
84
                removable: true
 
85
                onItemRemoved: console.log("Item removed");
 
86
            }
 
87
 
 
88
            StandardMenu {
 
89
                text: i18n.tr("Inverted colors Version")
 
90
                backColor: theme.palette.normal.baseText
 
91
                foregroundColor: theme.palette.normal.base
 
92
                highlightColor: theme.palette.highlighted.backgroundText
 
93
            }
 
94
 
 
95
            StandardMenu {
 
96
                iconName: "calendar"
67
97
                iconColor: "red"
68
 
                text: i18n.tr("Standard Menu")
 
98
                text: i18n.tr("Standard Menu with Component")
69
99
                component: Component {
70
100
                    Button {
71
101
                        text: "Press Me"
 
102
                        onClicked: print("Button pressed!")
72
103
                    }
73
104
                }
74
 
                backColor: Qt.rgba(1,1,1,0.1)
75
105
            }
76
106
 
 
107
            SeparatorMenu {}
 
108
 
77
109
            SliderMenu {
78
110
                id: slider
79
111
                text: i18n.tr("Slider")
97
129
                value: slider.value
98
130
            }
99
131
 
 
132
            SeparatorMenu {}
 
133
 
100
134
            ButtonMenu {
101
135
                text: i18n.tr("Button")
102
136
                buttonText: i18n.tr("Hello world!")
105
139
            CheckableMenu {
106
140
                text: i18n.tr("Checkable")
107
141
                checked: true
 
142
                onCheckedChanged: print("Checked status is", checked);
 
143
                onTriggered: print("Triggered", value)
108
144
            }
109
145
 
110
146
            SwitchMenu {
111
147
                text: i18n.tr("Switch")
112
148
                checked: true
 
149
                onCheckedChanged: print("Checked status is", checked);
 
150
                onTriggered: print("Triggered", value)
113
151
            }
114
152
 
115
153
            SectionMenu {
127
165
                name: i18n.tr("Lola Chang")
128
166
                iconSource: "image://theme/contact"
129
167
                active: true
 
168
                onTriggered: active = !active
130
169
            }
131
170
 
132
171
            MediaPlayerMenu {
180
219
            }
181
220
 
182
221
            ModemInfoItem {
 
222
                simIdentifierText: "SIM 1"
183
223
                statusText: "EE 4G"
184
224
                statusIcon: "gsm-3g-full"
185
225
                roaming: true
186
226
                locked: false
 
227
                onTriggered: roaming = !roaming
 
228
            }
 
229
 
 
230
            ModemInfoItem {
 
231
                simIdentifierText: "SIM 2"
 
232
                statusText: "Ubuntu 5G"
 
233
                statusIcon: "gsm-3g-medium-secure"
 
234
                roaming: false
 
235
                locked: true
 
236
                onUnlock: locked = false
 
237
                onTriggered: {
 
238
                    if (locked) {
 
239
                        roaming = !roaming
 
240
                    } else {
 
241
                        locked = true
 
242
                    }
 
243
                }
187
244
            }
188
245
 
189
246
            GroupedMessageMenu {