Skip to content

Commit

Permalink
Add connectivity icons for wifi and gsm
Browse files Browse the repository at this point in the history
Fixes #1552
  • Loading branch information
DanielMcInnes committed Nov 5, 2024
1 parent 59642c0 commit c6dd147
Show file tree
Hide file tree
Showing 10 changed files with 91 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,11 @@ qt_add_resources(${PROJECT_NAME} "${PROJECT_NAME}_large_resources"
images/icon_close_32.svg
images/icon_info_32.svg
images/icon_info_48.svg
images/icon_WiFi_1_32.svg
images/icon_WiFi_2_32.svg
images/icon_WiFi_3_32.svg
images/icon_WiFi_4_32.svg
images/icon_WiFi_noconnection_32.svg
images/welcome-brief.png
images/welcome-controls.png
images/welcome-dark.png
Expand Down
43 changes: 43 additions & 0 deletions components/StatusBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import QtQuick
import QtQuick.Controls as C
import QtQuick.Controls.impl as CP
import Victron.VenusOS

Rectangle {
Expand Down Expand Up @@ -104,6 +105,48 @@ Rectangle {
text: root.title.length > 0 ? root.title : ClockTime.currentTime
}

Row {
id: connectivityRow

anchors {
left: clockLabel.right
leftMargin: Theme.geometry_statusBar_rightSideRow_horizontalMargin
verticalCenter: parent.verticalCenter
}
spacing: Theme.geometry_statusBar_rightSideRow_horizontalMargin

CP.IconImage {
anchors.verticalCenter: parent.verticalCenter
color: Theme.color_font_primary
source: {
if (!signalStrength.isValid) {
return ""
} else if (signalStrength.value > 75) {
return "qrc:/images/icon_WiFi_4_32.svg"
} else if (signalStrength.value > 50) {
return "qrc:/images/icon_WiFi_3_32.svg"
} else if (signalStrength.value > 25) {
return "qrc:/images/icon_WiFi_2_32.svg"
} else if (signalStrength.value > 0) {
return "qrc:/images/icon_WiFi_1_32.svg"
} else {
return "qrc:/images/icon_WiFi_noconnection_32.svg"
}
}

VeQuickItem {
id: signalStrength

uid: Global.venusPlatform.serviceUid + "/Network/Wifi/SignalStrength"
}
}

GsmStatusIcon {
height: Theme.geometry_status_bar_gsmModem_icon_height
anchors.verticalCenter: parent.verticalCenter
}
}

Row {
id: rightSideRow
anchors {
Expand Down
6 changes: 6 additions & 0 deletions images/icon_WiFi_1_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/icon_WiFi_2_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/icon_WiFi_3_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions images/icon_WiFi_4_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions images/icon_WiFi_error_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions images/icon_WiFi_noconnection_32.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions themes/geometry/FiveInch.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@
"geometry_settings_gsmModem_signalStrengthBars_bar_width": 4,
"geometry_settings_gsmModem_signalStrengthBars_bar_incremental_height": 6,

"geometry_status_bar_gsmModem_icon_height": 24,

"geometry_vebusDeviceListPage_quantityTable_row_spacing": 4,
"geometry_vebusDeviceListPage_quantityTable_firstColumn_width": 39,
"geometry_vebusDeviceListPage_quantityTable_header_height": 58,
Expand Down
2 changes: 2 additions & 0 deletions themes/geometry/SevenInch.json
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@
"geometry_settings_gsmModem_signalStrengthBars_bar_width": 4,
"geometry_settings_gsmModem_signalStrengthBars_bar_incremental_height": 6,

"geometry_status_bar_gsmModem_icon_height": 24,

"geometry_vebusDeviceListPage_quantityTable_row_spacing": 4,
"geometry_vebusDeviceListPage_quantityTable_firstColumn_width": 39,
"geometry_vebusDeviceListPage_quantityTable_header_height": 58,
Expand Down

0 comments on commit c6dd147

Please sign in to comment.