Nav bar trash icon loads state at startup

This commit is contained in:
Jeremy Soller 2024-01-31 14:15:21 -07:00
parent 2e84a26f7e
commit 60eeb724d1
2 changed files with 2 additions and 7 deletions

View file

@ -512,12 +512,7 @@ impl Application for App {
}
nav_model = nav_model.insert(|b| {
b.text(fl!("trash"))
.icon(
//TODO: dynamic empty/full icon
widget::icon::from_name("user-trash-full-symbolic")
.size(16)
.icon(),
)
.icon(widget::icon::icon(tab::trash_icon_symbolic(16)))
.data(Location::Trash)
});

View file

@ -103,7 +103,7 @@ pub fn folder_icon_symbolic(path: &PathBuf, icon_size: u16) -> widget::icon::Han
.handle()
}
fn trash_icon_symbolic(icon_size: u16) -> widget::icon::Handle {
pub fn trash_icon_symbolic(icon_size: u16) -> widget::icon::Handle {
let full = match trash::os_limited::list() {
Ok(entries) => !entries.is_empty(),
Err(_err) => false,