Added a text to display wifi status.

This commit is contained in:
unrealdragon 2026-09-14 15:31:21 +05:30
commit b8201398e1

View file

@ -14,6 +14,7 @@ Window {
property color dark_accent_color: "#FF5F7F5F"
property color danger_color: "#F0AF2F1F"
property color water_color: "#F00F7FAF"
property color water_color_above_alert: "#F00FAF0F"
property color background_color: "#1F1F1F"
Material.accent: root.accent_color
property int font_enlarged_text_size: 20
@ -21,6 +22,7 @@ Window {
property int distance_count_thres: 3
property string mode: "http"
property string status: "Initializing"
property string connection_text_string: "Reading WiFi Status..."
property string alarm_status_text: ""
property var root_config: ({})
@ -73,6 +75,19 @@ Window {
}
}
Text {
id: connection_text
anchors {
top: top_bar.bottom
topMargin: 20
bottom: tank.top
horizontalCenter: parent.horizontalCenter
}
text: root.connection_text_string
color: root.accent_color
font.pointSize: root.font_normal_text_size
}
WaterTank {
id: tank
anchors {
@ -207,6 +222,16 @@ Window {
onRequestFailed: () => {
status.color = root.danger_color;
}
onConnectionText: (text, error) => {
root.connection_text_string = text
if(!error) {
connection_text.color = root.accent_color
}
else {
connection_text.color = root.danger_color
}
}
}
ConfigInterface {