switched to greedy freedesktop-icons implementation

This commit is contained in:
nik012003
2023-07-25 11:50:40 +02:00
parent 3a396340db
commit c679557314
3 changed files with 299 additions and 356 deletions

641
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,7 @@ color-eyre = "0.6.2"
directories = "5.0.0"
dirs = "5.0.0"
ez-pixmap = "0.2.2"
freedesktop-icons = "0.2.3"
freedesktop-icons-greedy = "0.2.5"
glam = { version = "0.24.0", features = ["mint"] }
image = "0.24.5"
lazy_static = "1.4.0"
@@ -30,7 +30,7 @@ tokio = { version = "1.24.1", features = ["full"] }
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
tween = "2.0.0"
ustr = "0.9.0"
walkdir = "2.3.2"
walkdir = "2.3.3"
[dev-dependencies]
tempdir = "0.3.7"
tempdir = "0.3.7"

View File

@@ -1,5 +1,5 @@
use color_eyre::eyre::Result;
use freedesktop_icons::lookup;
use freedesktop_icons_greedy::lookup;
use lazy_static::lazy_static;
use regex::Regex;
use resvg::render;
@@ -243,7 +243,6 @@ impl DesktopFile {
return Some(icon);
}
}
print!("Cache miss")
}
let preferred_theme = match linicon_theme::get_icon_theme() {
@@ -254,7 +253,7 @@ impl DesktopFile {
if let Some(icon_path) = lookup(icon_name)
.with_size(preferred_px_size)
.with_theme(preferred_theme.as_str())
.with_cache()
.with_greed()
.find()
{
if let Some(icon) = Icon::from_path(icon_path, preferred_px_size) {
@@ -266,7 +265,7 @@ impl DesktopFile {
if let Some(icon_path) = lookup(icon_name)
.with_size(icon_size)
.with_theme(preferred_theme.as_str())
.with_cache()
.with_greed()
.find()
{
if let Some(icon) = Icon::from_path(icon_path, preferred_px_size) {
@@ -317,7 +316,6 @@ impl Icon {
.to_owned(),
size,
)) {
print!("Saving in the cache");
IMAGE_CACHE.lock().unwrap().insert(
(
self.path