Skip to content

Commit 7a28e52

Browse files
authored
Merge pull request #288 from sudo-Tiz/feature/bluetooth_indicator_icon
feat(bluetooth): change indicator icon on connected status
2 parents c716ba7 + 5cc40ee commit 7a28e52

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

assets/ashell_icon.ttf

140 Bytes
Binary file not shown.

src/components/icons.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub enum StaticIcon {
5656
Ethernet,
5757
Vpn,
5858
Bluetooth,
59+
BluetoothConnected,
5960
PowerSaver,
6061
Balanced,
6162
Performance,
@@ -154,6 +155,7 @@ impl Icon for StaticIcon {
154155
StaticIcon::Ethernet => "\u{f0200}",
155156
StaticIcon::Vpn => "\u{f0582}",
156157
StaticIcon::Bluetooth => "\u{f00af}",
158+
StaticIcon::BluetoothConnected => "\u{f00b1}",
157159
StaticIcon::PowerSaver => "\u{f0f86}",
158160
StaticIcon::Balanced => "\u{f0f85}",
159161
StaticIcon::Performance => "\u{f04c5}",

src/modules/settings/bluetooth.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,13 @@ impl BluetoothSettings {
413413
) -> Option<Element<'a, Message>> {
414414
if let Some(service) = &self.service
415415
&& service.state == BluetoothState::Active
416-
&& !service.devices.is_empty()
417416
{
418-
return Some(icon(StaticIcon::Bluetooth).into());
417+
let connected_count = service.devices.iter().filter(|d| d.connected).count();
418+
if connected_count > 0 {
419+
return Some(icon(StaticIcon::BluetoothConnected).into());
420+
} else {
421+
return Some(icon(StaticIcon::Bluetooth).into());
422+
}
419423
}
420424
None
421425
}

0 commit comments

Comments
 (0)