mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-08 12:13:31 -04:00
feat: Blink WiFi/Bluetooth icons while connecting (#2448)
Pulses the WiFi and Bluetooth status icons while a connection is in progress (lock screen, DankBar control center button, control center compound pill). The pulse is implemented as a reusable Widgets/DankBlink component, and the wifi-connecting condition is centralized as NetworkService.isWifiConnecting. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -131,9 +131,19 @@ BasePill {
|
||||
function getNetworkIconColor() {
|
||||
if (NetworkService.wifiToggling)
|
||||
return Theme.primary;
|
||||
if (NetworkService.isConnecting && !NetworkService.ethernetConnected)
|
||||
return Theme.primary;
|
||||
return NetworkService.networkStatus !== "disconnected" ? Theme.primary : Theme.surfaceText;
|
||||
}
|
||||
|
||||
function getIconBlinking(id) {
|
||||
if (id === "network")
|
||||
return NetworkService.isWifiConnecting;
|
||||
if (id === "bluetooth")
|
||||
return BluetoothService.connecting;
|
||||
return false;
|
||||
}
|
||||
|
||||
function getVolumeIconName() {
|
||||
if (!AudioService.sink?.audio)
|
||||
return "volume_up";
|
||||
@@ -485,6 +495,7 @@ BasePill {
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
id: vIconOnlyItem
|
||||
anchors.centerIn: parent
|
||||
visible: !verticalGroupItem.modelData.composite
|
||||
name: {
|
||||
@@ -515,7 +526,7 @@ BasePill {
|
||||
case "vpn":
|
||||
return NetworkService.vpnConnected ? Theme.primary : Theme.surfaceText;
|
||||
case "bluetooth":
|
||||
return BluetoothService.connected ? Theme.primary : Theme.surfaceText;
|
||||
return (BluetoothService.connected || BluetoothService.connecting) ? Theme.primary : Theme.surfaceText;
|
||||
case "battery":
|
||||
return root.getBatteryIconColor();
|
||||
case "printer":
|
||||
@@ -524,6 +535,11 @@ BasePill {
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
}
|
||||
|
||||
DankBlink {
|
||||
target: vIconOnlyItem
|
||||
running: root.getIconBlinking(verticalGroupItem.modelData.id)
|
||||
}
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -687,7 +703,7 @@ BasePill {
|
||||
case "vpn":
|
||||
return NetworkService.vpnConnected ? Theme.primary : Theme.surfaceText;
|
||||
case "bluetooth":
|
||||
return BluetoothService.connected ? Theme.primary : Theme.surfaceText;
|
||||
return (BluetoothService.connected || BluetoothService.connecting) ? Theme.primary : Theme.surfaceText;
|
||||
case "battery":
|
||||
return root.getBatteryIconColor();
|
||||
case "printer":
|
||||
@@ -696,6 +712,11 @@ BasePill {
|
||||
return Theme.widgetIconColor;
|
||||
}
|
||||
}
|
||||
|
||||
DankBlink {
|
||||
target: iconOnlyItem
|
||||
running: root.getIconBlinking(horizontalGroupItem.modelData.id)
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
Reference in New Issue
Block a user