lux-shell/modules/bar/components/Network.qml
Benjamin Palko 96d8ab6534 reorg bar
2025-09-06 22:59:32 -04:00

52 lines
1.2 KiB
QML

import qs.components
import qs.config
import qs.services
import qs.utils
import QtQuick
import QtQuick.Layouts
RowLayout {
Ref {
service: NetworkService
}
LucideIcon {
id: icon
text: Styling.lucide.icons.wifiOff
states: [
State {
name: "high"
when: NetworkService.active?.strength > 50
PropertyChanges {
icon {
text: Styling.lucide.icons.wifi
}
}
},
State {
name: "medium"
when: NetworkService.active?.strength > 25
PropertyChanges {
icon {
text: Styling.lucide.icons.wifiHigh
}
}
},
State {
name: "low"
when: NetworkService.active?.strength > 0
PropertyChanges {
icon {
text: Styling.lucide.icons.wifiLow
}
}
}
]
}
StyledText {
id: text
text: ` ${(NetworkService.active?.strength ?? 0).toFixed()}%`
}
}