File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
cosmic-settings/src/pages/networking Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ fn devices_view() -> Section<crate::pages::Message> {
590
590
} ;
591
591
592
592
let identifier = widget:: row:: with_capacity ( 3 )
593
- . push ( widget:: icon:: from_name ( " network-wireless-good-symbolic" ) )
593
+ . push ( widget:: icon:: from_name ( wifi_icon ( network. strength ) ) )
594
594
. push_maybe (
595
595
is_encrypted
596
596
. then ( || widget:: icon:: from_name ( "connection-secure-symbolic" ) ) ,
@@ -785,3 +785,15 @@ pub fn update_devices(conn: zbus::Connection) -> Command<crate::app::Message> {
785
785
}
786
786
} )
787
787
}
788
+
789
+ fn wifi_icon ( strength : u8 ) -> & ' static str {
790
+ if strength < 25 {
791
+ "network-wireless-signal-weak-symbolic"
792
+ } else if strength < 50 {
793
+ "network-wireless-signal-ok-symbolic"
794
+ } else if strength < 75 {
795
+ "network-wireless-signal-good-symbolic"
796
+ } else {
797
+ "network-wireless-signal-excellent-symbolic"
798
+ }
799
+ }
You can’t perform that action at this time.
0 commit comments