Debian Codegraph @

online-accounts-plugins/lib/module/qml5/ServiceItemBase.qml

raw
1 /*
2 * Copyright (C) 2016 Canonical Ltd.
3 *
4 * Contact: Alberto Mardegan <[email protected]>
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 3, as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranties of
12 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13 * PURPOSE. See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 import QtQuick 2.9
20 import Lomiri.Components 1.3
21 import Lomiri.Components.ListItems 1.3 as ListItem
22
23 ListItem.Base {
24 property alias checked: control.checked
25 property alias text: label.text
26 property alias subText: subLabel.text
27
28 Item {
29 anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter }
30 height: childrenRect.height + label.anchors.topMargin + subLabel.anchors.bottomMargin
31
32 Label {
33 id: label
34 anchors { left: parent.left; right: control.left; top: parent.top }
35 elide: Text.ElideRight
36 color: theme.palette.selected.backgroundText
37 }
38
39 Label {
40 id: subLabel
41 anchors { left: parent.left; right: control.left; top: label.bottom }
42 color: theme.palette.normal.backgroundText
43 elide: Text.ElideRight
44 textSize: Label.Small
45 }
46
47 Switch {
48 anchors { right: parent.right; verticalCenter: parent.verticalCenter }
49 id: control
50 }
51 }
52 }