Skip to content

Commit 1026c8b

Browse files
committed
UI Controls: change gsm status icon to clickable button
Contributes to #2834
1 parent 71efa7d commit 1026c8b

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

components/StatusBar.qml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ FocusScope {
2525
signal rightButtonClicked()
2626
signal auxButtonClicked()
2727
signal wifiButtonClicked()
28+
signal gsmButtonClicked()
2829
// PageStack.get(...) returns an Item, so the arg for 'popToPage' needs to be 'Item'. If we make it a 'Page', it works fine on the desktop,
2930
// but shows an unusual failure on the device. There is an error message about "passing incompatible arguments to signals is not supported",
3031
// and the page stack pops 1 too many pages.
@@ -246,7 +247,7 @@ FocusScope {
246247
: signalStrength.value > 0 ? "qrc:/images/icon_WiFi_1_32.svg"
247248
: "qrc:/images/icon_WiFi_noconnection_32.svg"
248249

249-
KeyNavigation.right: notificationButton
250+
KeyNavigation.right: gsmButton
250251

251252
onClicked: root.wifiButtonClicked()
252253

@@ -257,9 +258,20 @@ FocusScope {
257258
}
258259
}
259260

260-
GsmStatusIcon {
261-
height: Theme.geometry_status_bar_gsmModem_icon_height
262-
anchors.verticalCenter: parent.verticalCenter
261+
StatusBarButton {
262+
id: gsmButton
263+
264+
visible: gsmIcon.valid
265+
266+
KeyNavigation.right: notificationButton
267+
268+
onClicked: root.gsmButtonClicked()
269+
270+
GsmStatusIcon {
271+
id: gsmIcon
272+
height: Theme.geometry_status_bar_gsmModem_icon_height
273+
anchors.centerIn: parent
274+
}
263275
}
264276
}
265277

pages/MainView.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ FocusScope {
431431
{"title": qsTrId("pagesettingsconnectivity_wifi")})
432432
}
433433

434+
onGsmButtonClicked: {
435+
Global.pageManager.pushPage("/pages/settings/PageSettingsGsm.qml",
436+
{"title": qsTrId("pagesettingsconnectivity_mobile_network")})
437+
}
438+
434439
onPopToPage: function(toPage) {
435440
pageManager.popPage(toPage)
436441
}

0 commit comments

Comments
 (0)