feat: improve mime app detection & do it faster
This commit is contained in:
parent
bf01bb31a3
commit
53cfeebe57
3 changed files with 121 additions and 110 deletions
14
src/tab.rs
14
src/tab.rs
|
|
@ -2374,8 +2374,11 @@ impl Item {
|
|||
widget::settings::item::builder(fl!("open-with")).control(
|
||||
Element::from(
|
||||
widget::dropdown(
|
||||
mime_apps,
|
||||
mime_apps.iter().position(|x| x.is_default),
|
||||
mime_apps
|
||||
.iter()
|
||||
.map(|app| Cow::Owned(app.name.clone()))
|
||||
.collect::<Vec<Cow<'static, str>>>(),
|
||||
mime_apps.iter().position(|x| x.is_default()),
|
||||
move |index| index,
|
||||
)
|
||||
.icons(Cow::Borrowed(mime_app_cache.icons(&self.mime))),
|
||||
|
|
@ -6455,8 +6458,11 @@ impl Tab {
|
|||
widget::settings::item::builder(fl!("open-with")).control(
|
||||
Element::from(
|
||||
widget::dropdown(
|
||||
mime_apps,
|
||||
mime_apps.iter().position(|x| x.is_default),
|
||||
mime_apps
|
||||
.iter()
|
||||
.map(|app| Cow::Owned(app.name.clone()))
|
||||
.collect::<Vec<Cow<'static, str>>>(),
|
||||
mime_apps.iter().position(|x| x.is_default()),
|
||||
move |index| (index, mime_closure.clone()),
|
||||
)
|
||||
.icons(Cow::Borrowed(mime_app_cache.icons(&mime))),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue