controlcenter: updated wireless icons

This commit is contained in:
ATMDA 2025-11-20 08:36:10 -05:00
parent ae74eabfca
commit 5a369702d1
2 changed files with 23 additions and 44 deletions

View file

@ -138,44 +138,11 @@ DeviceList {
id: icon id: icon
anchors.centerIn: parent anchors.centerIn: parent
text: Icons.getNetworkIcon(modelData.strength) text: Icons.getNetworkIcon(modelData.strength, modelData.isSecure)
font.pointSize: Appearance.font.size.large font.pointSize: Appearance.font.size.large
fill: modelData.active ? 1 : 0 fill: modelData.active ? 1 : 0
color: modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface color: modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
} }
StyledRect {
id: lockBadge
visible: modelData.isSecure
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: -Appearance.padding.smaller / 2
implicitWidth: lockIconSize + Appearance.padding.smaller
implicitHeight: lockIconSize + Appearance.padding.smaller
radius: Appearance.rounding.full
color: Colours.palette.m3secondaryContainer
readonly property real lockIconSize: lockIcon.implicitWidth
Elevation {
anchors.fill: parent
radius: parent.radius
z: -1
level: 2
}
MaterialIcon {
id: lockIcon
anchors.centerIn: parent
text: "lock"
font.pointSize: Appearance.font.size.small
fill: 1
color: Colours.palette.m3onSurface
}
}
} }
ColumnLayout { ColumnLayout {

View file

@ -116,9 +116,20 @@ Singleton {
return fallback; return fallback;
} }
function getNetworkIcon(strength: int): string { function getNetworkIcon(strength: int, isSecure = false): string {
if (isSecure) {
if (strength >= 80) if (strength >= 80)
return "signal_wifi_4_bar"; return "network_wifi_locked";
if (strength >= 60)
return "network_wifi_3_bar_locked";
if (strength >= 40)
return "network_wifi_2_bar_locked";
if (strength >= 20)
return "network_wifi_1_bar_locked";
return "signal_wifi_0_bar";
} else {
if (strength >= 80)
return "network_wifi";
if (strength >= 60) if (strength >= 60)
return "network_wifi_3_bar"; return "network_wifi_3_bar";
if (strength >= 40) if (strength >= 40)
@ -127,6 +138,7 @@ Singleton {
return "network_wifi_1_bar"; return "network_wifi_1_bar";
return "signal_wifi_0_bar"; return "signal_wifi_0_bar";
} }
}
function getBluetoothIcon(icon: string): string { function getBluetoothIcon(icon: string): string {
if (icon.includes("headset") || icon.includes("headphones")) if (icon.includes("headset") || icon.includes("headphones"))