Only show networks in side bar if a mounter is found

This commit is contained in:
Jeremy Soller 2024-09-18 10:24:22 -06:00
parent a40e6cdff4
commit 8668c18607
No known key found for this signature in database
GPG key ID: D02FD439211AF56F

View file

@ -671,19 +671,21 @@ impl App {
.divider_above()
});
nav_model = nav_model.insert(|b| {
b.text(fl!("networks"))
.icon(widget::icon::icon(
widget::icon::from_name("network-workgroup-symbolic")
.size(16)
.handle(),
))
.data(Location::Network(
"network:///".to_string(),
fl!("networks"),
))
.divider_above()
});
if !self.mounters.is_empty() {
nav_model = nav_model.insert(|b| {
b.text(fl!("networks"))
.icon(widget::icon::icon(
widget::icon::from_name("network-workgroup-symbolic")
.size(16)
.handle(),
))
.data(Location::Network(
"network:///".to_string(),
fl!("networks"),
))
.divider_above()
});
}
// Collect all mounter items
let mut nav_items = Vec::new();