on bbbdccd help sign in
unity8/qml/Panel/Indicators/ModemInfoItem.qml
111 lines 3.3 kB history raw
1/*
2 * Copyright 2014,2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
20import Ubuntu.Components.ListItems 1.3 as ListItem
22ListItem.Empty {
23 id: menu
24 implicitHeight: mainColumn.implicitHeight
25 + mainColumn.anchors.topMargin
26 + mainColumn.anchors.bottomMargin
28 property alias statusIcon: statusIcon.name
29 property alias statusText: labelStatus.text
30 property alias connectivityIcon: iconConnectivity.name
31 property alias simIdentifierText: labelSimIdentifier.text
32 property bool locked : false
33 property bool roaming: false
34 signal unlock
36 ColumnLayout {
37 id: mainColumn
38 anchors.fill: parent
39 anchors.margins: menu.__contentsMargins
40 spacing: units.gu(0.5)
42 Label {
43 id: labelSimIdentifier
44 elide: Text.ElideRight
45 visible: text !== ""
46 font.bold: true
47 opacity: menu.locked ? 0.6 : 1.0
48 }
50 RowLayout {
51 id: statusRow
52 spacing: units.gu(1)
54 height: labelStatus.height
55 width: parent.width
57 Label {
58 id: labelStatus
59 elide: Text.ElideRight
60 opacity: 0.6
61 }
63 RowLayout {
64 spacing: 0.5
65 height: parent.height
66 Icon {
67 id: statusIcon
68 color: theme.palette.selected.backgroundText
70 Layout.preferredHeight: parent.height
71 Layout.preferredWidth: Layout.preferredHeight
73 visible: name !== ""
74 }
76 Icon {
77 id: iconConnectivity
78 color: theme.palette.selected.backgroundText
80 Layout.preferredHeight: parent.height
81 Layout.preferredWidth: Layout.preferredHeight
83 visible: name !== ""
84 }
85 }
87 Item {
88 // eat up all the excess space so that RoamingIndication
89 // ends up to the far right
90 Layout.fillWidth: true
91 }
93 RoamingIndication {
94 id: roamingIndication
95 visible: menu.roaming
96 Layout.fillHeight: true
97 }
98 }
100 Button {
101 id: buttonUnlock
102 objectName: "buttonUnlockSim"
103 visible: menu.locked
105 text: i18n.tr("Unlock SIM")
106 Layout.preferredWidth: implicitWidth + units.gu(5)
108 onTriggered: menu.unlock()
109 }
110 }