on xenial help sign in
revised modem info item.
3614d99Antti Kaijanmäki
qml/Panel/Indicators/MenuItemFactory.qml+7−7
@@ -384,42 +384,42 @@ Item {
384 property int menuIndex: -1
384 property int menuIndex: -1
385 property var extendedData: menuData && menuData.ext || undefined
385 property var extendedData: menuData && menuData.ext || undefined
386
386
387− property var statusLabelAction: QMenuModel.UnityMenuAction {
387+ property var statusLabelAction: UnityMenuAction {
388 model: menuModel
388 model: menuModel
389 index: menuIndex
389 index: menuIndex
390 name: getExtendedProperty(extendedData, "xCanonicalModemStatusLabelAction", "")
390 name: getExtendedProperty(extendedData, "xCanonicalModemStatusLabelAction", "")
391 }
391 }
392 statusText: statusLabelAction.valid ? statusLabelAction.state : ""
392 statusText: statusLabelAction.valid ? statusLabelAction.state : ""
393
393
394− property var statusIconAction: QMenuModel.UnityMenuAction {
394+ property var statusIconAction: UnityMenuAction {
395 model: menuModel
395 model: menuModel
396 index: menuIndex
396 index: menuIndex
397 name: getExtendedProperty(extendedData, "xCanonicalModemStatusIconAction", "")
397 name: getExtendedProperty(extendedData, "xCanonicalModemStatusIconAction", "")
398 }
398 }
399 statusIcon: statusIconAction.valid ? statusIconAction.state : ""
399 statusIcon: statusIconAction.valid ? statusIconAction.state : ""
400
400
401− property var connectivityIconAction: QMenuModel.UnityMenuAction {
401+ property var connectivityIconAction: UnityMenuAction {
402 model: menuModel
402 model: menuModel
403 index: menuIndex
403 index: menuIndex
404 name: getExtendedProperty(extendedData, "xCanonicalModemConnectivityIconAction", "")
404 name: getExtendedProperty(extendedData, "xCanonicalModemConnectivityIconAction", "")
405 }
405 }
406 connectivityIcon: connectivityIconAction.valid ? connectivityIconAction.state : ""
406 connectivityIcon: connectivityIconAction.valid ? connectivityIconAction.state : ""
407
407
408− property var simIdentifierLabelAction: QMenuModel.UnityMenuAction {
408+ property var simIdentifierLabelAction: UnityMenuAction {
409 model: menuModel
409 model: menuModel
410 index: menuIndex
410 index: menuIndex
411 name: getExtendedProperty(extendedData, "xCanonicalModemSimIdentifierLabelAction", "")
411 name: getExtendedProperty(extendedData, "xCanonicalModemSimIdentifierLabelAction", "")
412 }
412 }
413 simIdentifierText: simIdentifierLabelAction.valid ? simIdentifierLabelAction.state : ""
413 simIdentifierText: simIdentifierLabelAction.valid ? simIdentifierLabelAction.state : ""
414
414
415− property var roamingAction: QMenuModel.UnityMenuAction {
415+ property var roamingAction: UnityMenuAction {
416 model: menuModel
416 model: menuModel
417 index: menuIndex
417 index: menuIndex
418 name: getExtendedProperty(extendedData, "xCanonicalModemRoamingAction", "")
418 name: getExtendedProperty(extendedData, "xCanonicalModemRoamingAction", "")
419 }
419 }
420 roaming: roamingAction.valid ? roamingAction.state : false
420 roaming: roamingAction.valid ? roamingAction.state : false
421
421
422− property var unlockAction: QMenuModel.UnityMenuAction {
422+ property var unlockAction: UnityMenuAction {
423 model: menuModel
423 model: menuModel
424 index: menuIndex
424 index: menuIndex
425 name: getExtendedProperty(extendedData, "xCanonicalModemLockedAction", "")
425 name: getExtendedProperty(extendedData, "xCanonicalModemLockedAction", "")
@@ -442,7 +442,7 @@ Item {
442 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-modem-status-label-action': 'string',
442 menuModel.loadExtendedAttributes(menuIndex, {'x-canonical-modem-status-label-action': 'string',
443 'x-canonical-modem-status-icon-action': 'string',
443 'x-canonical-modem-status-icon-action': 'string',
444 'x-canonical-modem-connectivity-icon-action': 'string',
444 'x-canonical-modem-connectivity-icon-action': 'string',
445− 'x-canonical-modem-sim-identifier-label': 'string',
445+ 'x-canonical-modem-sim-identifier-label-action': 'string',
446 'x-canonical-modem-roaming-action': 'string',
446 'x-canonical-modem-roaming-action': 'string',
447 'x-canonical-modem-locked-action': 'string'});
447 'x-canonical-modem-locked-action': 'string'});
448 }
448 }
qml/Panel/Indicators/ModemInfoItem.qml+54−66
@@ -18,12 +18,15 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21+import QtQuick.Layouts 1.1
21import Ubuntu.Components 0.1
22import Ubuntu.Components 0.1
22import Ubuntu.Components.ListItems 0.1 as ListItem
23import Ubuntu.Components.ListItems 0.1 as ListItem
23
24
24ListItem.Empty {
25ListItem.Empty {
25 id: menu
26 id: menu
26− implicitHeight: units.gu(5.5)
27+ implicitHeight: mainColumn.implicitHeight
28+ + mainColumn.anchors.topMargin
29+ + mainColumn.anchors.bottomMargin
27
30
28 property alias statusIcon: statusIcon.name
31 property alias statusIcon: statusIcon.name
29 property alias statusText: labelStatus.text
32 property alias statusText: labelStatus.text
@@ -33,93 +36,78 @@ ListItem.Empty {
33 property bool roaming: false
36 property bool roaming: false
34 signal unlock
37 signal unlock
35
38
36− Row {
39+ ColumnLayout {
37− id: iconRow
40+ id: mainColumn
38− height: parent.height
41+ anchors.fill: parent
42+ anchors.margins: menu.__contentsMargins
43+ spacing: units.gu(0.5)
39
44
40− anchors {
45+ Label {
41− left: parent.left
46+ id: labelSimIdentifier
42− top: parent.top
47+ elide: Text.ElideRight
43− leftMargin: menu.__contentsMargins
48+ visible: text !== ""
44− verticalCenter: parent.verticalCenter
49+ font.bold: true
45− }
50+ opacity: menu.locked ? 0.6 : 1.0
46−
47− Icon {
48− id: statusIcon
49− color: Theme.palette.selected.backgroundText
50− keyColor: "#cccccc"
51−
52− width: height
53− height: Math.min(units.gu(5), parent.height - units.gu(1))
54 }
51 }
55
52
56− Icon {
53+ RowLayout {
57− id: iconConnectivity
54+ id: statusRow
58− color: Theme.palette.selected.backgroundText
55+ spacing: units.gu(1)
59− keyColor: "#cccccc"
60
56
61− width: height
57+ height: labelStatus.height
62− height: Math.min(units.gu(5), parent.height - units.gu(1))
58+ width: parent.width
63− }
64− }
65
59
66− Column {
60+ Label {
67− id: columnStatus
61+ id: labelStatus
68− anchors {
62+ elide: Text.ElideRight
69− left: iconRow.right
63+ opacity: 0.6
70− leftMargin: units.gu(1)
71− verticalCenter: parent.verticalCenter
72− rightMargin: menu.__contentsMargins
73− }
64+ }
74
65
75− Label {
66+ RowLayout {
76− id: labelStatus
67+ spacing: 0.5
68+ height: parent.height
69+ Icon {
70+ id: statusIcon
71+ color: Theme.palette.selected.backgroundText
77
72
78− elide: Text.ElideRight
73+ width: height
79− }
74+ height: parent.height
80
75
81− Label {
76+ visible: name !== ""
82− id: labelSimIdentifier
77+ }
83
78
84− elide: Text.ElideRight
79+ Icon {
85− visible: text !== ""
80+ id: iconConnectivity
81+ color: Theme.palette.selected.backgroundText
86
82
87− fontSize: "x-small"
83+ width: height
88− font.bold: true
84+ height: parent.height
89− }
90− }
91
85
92− Item {
86+ visible: name !== ""
93− height: parent.height
87+ }
88+ }
94
89
95− anchors {
90+ Item {
96− right: parent.right
91+ // eat up all the excess space so that RoamingIndication
97− rightMargin: menu.__contentsMargins
92+ // ends up to the far right
98− verticalCenter: parent.verticalCenter
93+ Layout.fillWidth: true
99− }
94+ }
100
95
101− RoamingIndication {
96+ RoamingIndication {
102− id: roamingIndication
97+ id: roamingIndication
103− anchors {
98+ visible: menu.roaming
104− right: parent.right
99+ height: parent.height
105− verticalCenter: parent.verticalCenter
106 }
100 }
107− visible: menu.roaming
108− height: Math.min(units.gu(5), parent.height - units.gu(1))
109 }
101 }
110
102
111 Button {
103 Button {
112− anchors {
113− right: parent.right
114− verticalCenter: parent.verticalCenter
115− }
116 id: buttonUnlock
104 id: buttonUnlock
117 objectName: "buttonUnlockSim"
105 objectName: "buttonUnlockSim"
118 visible: menu.locked
106 visible: menu.locked
119
107
120− text: i18n.tr("Unlock")
108+ text: i18n.tr("Unlock SIM")
109+ Layout.preferredWidth: implicitWidth + units.gu(5)
121
110
122− height: Math.min(units.gu(4), parent.height - units.gu(1))
123 onTriggered: menu.unlock()
111 onTriggered: menu.unlock()
124 }
112 }
125 }
113 }
qml/Panel/Indicators/RoamingIndication.qml+12−23
@@ -18,38 +18,27 @@
18 */
18 */
19
19
20import QtQuick 2.0
20import QtQuick 2.0
21+import QtQuick.Layouts 1.1
22+
21import Ubuntu.Components 0.1
23import Ubuntu.Components 0.1
22
24
23−Item {
25+RowLayout {
24− width: (labelRoaming.width > iconRoaming.width) ? labelRoaming.width : iconRoaming.width
26+ spacing: units.gu(0.5)
27+ Label {
28+ id: labelRoaming
29+ elide: Text.ElideRight
30+ fontSize: "x-small"
31+ text: i18n.tr("Roaming")
32+ opacity: 0.6
33+ }
25
34
26 Icon {
35 Icon {
27 id: iconRoaming
36 id: iconRoaming
28− anchors {
29− top: parent.top
30− horizontalCenter: parent.horizontalCenter
31− }
32−
33 color: Theme.palette.selected.backgroundText
37 color: Theme.palette.selected.backgroundText
34− keyColor: "#cccccc"
35
38
39+ height: parent.height
36 width: height
40 width: height
37− height: units.gu(4)
38
41
39 name: "network-cellular-roaming"
42 name: "network-cellular-roaming"
40 }
43 }
41−
42− Label {
43− id: labelRoaming
44− anchors {
45− bottom: parent.bottom
46− horizontalCenter: parent.horizontalCenter
47− }
48− elide: Text.ElideRight
49−
50− fontSize: "x-small"
51− font.bold: true
52−
53− text: i18n.tr("roaming")
54− }
55}
44}