From 6946e95c88984dee75669d881cfdce47bfde9930 Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 5 May 2026 14:47:34 +0200 Subject: [PATCH 1/2] fix: prefer SVG file icons --- src/mime_icon.rs | 7 +++++-- src/tab.rs | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/mime_icon.rs b/src/mime_icon.rs index 91ec3e8..64f007f 100644 --- a/src/mime_icon.rs +++ b/src/mime_icon.rs @@ -45,7 +45,7 @@ impl MimeIconCache { return None; } let icon_name = icon_names.remove(0); - let mut named = icon::from_name(icon_name).size(key.size); + let mut named = icon::from_name(icon_name).prefer_svg(true).size(key.size); if !icon_names.is_empty() { let fallback_names = icon_names.into_iter().map(std::borrow::Cow::from).collect(); @@ -112,7 +112,10 @@ pub fn mime_icon(mime: Mime, size: u16) -> icon::Handle { let mut mime_icon_cache = MIME_ICON_CACHE.lock().unwrap(); match mime_icon_cache.get(MimeIconKey { mime, size }) { Some(handle) => handle, - None => icon::from_name(FALLBACK_MIME_ICON).size(size).handle(), + None => icon::from_name(FALLBACK_MIME_ICON) + .prefer_svg(true) + .size(size) + .handle(), } } diff --git a/src/tab.rs b/src/tab.rs index 659aa6d..ba3764f 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -269,6 +269,7 @@ fn button_style( pub fn folder_icon(path: &PathBuf, icon_size: u16) -> widget::icon::Handle { widget::icon::from_name(SPECIAL_DIRS.get(path).map_or("folder", |x| *x)) + .prefer_svg(true) .size(icon_size) .handle() } @@ -581,7 +582,10 @@ fn desktop_icon_handle(icon: &str, size: u16) -> widget::icon::Handle { if icon_path.is_absolute() && icon_path.exists() { widget::icon::from_path(icon_path.to_path_buf()) } else { - widget::icon::from_name(icon).size(size).handle() + widget::icon::from_name(icon) + .prefer_svg(true) + .size(size) + .handle() } } From 095940e9a9e00a800d441582df68f03e3721652f Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Tue, 5 May 2026 14:48:15 +0200 Subject: [PATCH 2/2] fix: small grid file icons --- src/tab.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tab.rs b/src/tab.rs index ba3764f..cade53d 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -5428,8 +5428,7 @@ impl Tab { widget::button::custom( widget::icon::icon(item.icon_handle_grid.clone()) .content_fit(ContentFit::Contain) - .size(icon_sizes.grid()) - .width(Length::Shrink), + .size(icon_sizes.grid()), ) .padding(space_xxxs) .class(button_style(