mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-13 06:33:30 -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:
@@ -301,12 +301,22 @@ Column {
|
||||
property var widgetDef: root.model?.getWidgetForId(widgetData.id || "")
|
||||
width: parent.width
|
||||
height: 60
|
||||
iconBlinking: {
|
||||
const id = widgetData.id || "";
|
||||
if (id === "wifi")
|
||||
return NetworkService.isWifiConnecting;
|
||||
if (id === "bluetooth")
|
||||
return BluetoothService.connecting;
|
||||
return false;
|
||||
}
|
||||
iconName: {
|
||||
switch (widgetData.id || "") {
|
||||
case "wifi":
|
||||
{
|
||||
if (NetworkService.wifiToggling)
|
||||
return "sync";
|
||||
if (NetworkService.isConnecting && !NetworkService.ethernetConnected)
|
||||
return NetworkService.wifiSignalIcon;
|
||||
|
||||
const status = NetworkService.networkStatus;
|
||||
if (status === "ethernet")
|
||||
@@ -360,6 +370,8 @@ Column {
|
||||
{
|
||||
if (NetworkService.wifiToggling)
|
||||
return NetworkService.wifiEnabled ? I18n.tr("Disabling WiFi...", "network status") : I18n.tr("Enabling WiFi...", "network status");
|
||||
if (NetworkService.isConnecting && !NetworkService.ethernetConnected)
|
||||
return NetworkService.connectingSSID || I18n.tr("Connecting...", "network status");
|
||||
|
||||
const status = NetworkService.networkStatus;
|
||||
if (status === "ethernet")
|
||||
@@ -400,6 +412,8 @@ Column {
|
||||
{
|
||||
if (NetworkService.wifiToggling)
|
||||
return I18n.tr("Please wait...", "network status");
|
||||
if (NetworkService.isConnecting && !NetworkService.ethernetConnected)
|
||||
return I18n.tr("Connecting...", "network status");
|
||||
|
||||
const status = NetworkService.networkStatus;
|
||||
if (status === "ethernet")
|
||||
@@ -422,6 +436,8 @@ Column {
|
||||
return I18n.tr("No adapters", "bluetooth status");
|
||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled)
|
||||
return I18n.tr("Off", "bluetooth status");
|
||||
if (BluetoothService.connecting)
|
||||
return I18n.tr("Connecting...", "bluetooth status");
|
||||
const primaryDevice = (() => {
|
||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
|
||||
return null;
|
||||
|
||||
@@ -10,6 +10,7 @@ Rectangle {
|
||||
|
||||
property string iconName: ""
|
||||
property color iconColor: Theme.surfaceText
|
||||
property bool iconBlinking: false
|
||||
property string primaryText: ""
|
||||
property string secondaryText: ""
|
||||
property bool expanded: false
|
||||
@@ -109,10 +110,16 @@ Rectangle {
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
id: pillIcon
|
||||
anchors.centerIn: parent
|
||||
name: iconName
|
||||
size: Theme.iconSize
|
||||
color: isActive ? _tileIconActive : _tileIconInactive
|
||||
|
||||
DankBlink {
|
||||
target: pillIcon
|
||||
running: root.iconBlinking
|
||||
}
|
||||
}
|
||||
|
||||
DankRipple {
|
||||
|
||||
Reference in New Issue
Block a user