This commit is contained in:
Jeremy Soller 2025-04-21 13:32:29 -06:00
parent 7598130650
commit 4f8d22c120
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
2 changed files with 147 additions and 139 deletions

View file

@ -544,13 +544,22 @@ pub fn menu_bar<'a>(
menu_button_optional( menu_button_optional(
fl!("open"), fl!("open"),
Action::Open, Action::Open,
(selected > 0 && selected_dir == 0) || (selected_dir == 1 && selected == 1), (selected > 0 && selected_dir == 0)
|| (selected_dir == 1 && selected == 1),
),
menu_button_optional(
fl!("menu-open-with"),
Action::OpenWith,
selected == 1,
), ),
menu_button_optional(fl!("menu-open-with"), Action::OpenWith, selected == 1),
menu::Item::Divider, menu::Item::Divider,
menu_button_optional(fl!("rename"), Action::Rename, selected > 0), menu_button_optional(fl!("rename"), Action::Rename, selected > 0),
menu::Item::Divider, menu::Item::Divider,
menu_button_optional(fl!("add-to-sidebar"), Action::AddToSidebar, selected > 0), menu_button_optional(
fl!("add-to-sidebar"),
Action::AddToSidebar,
selected > 0,
),
menu::Item::Divider, menu::Item::Divider,
menu_button_optional( menu_button_optional(
if in_trash { if in_trash {

View file

@ -334,8 +334,7 @@ impl MimeAppCache {
.entry(mime.clone()) .entry(mime.clone())
.or_insert_with(|| Vec::with_capacity(1)); .or_insert_with(|| Vec::with_capacity(1));
if !apps.iter().any(|x| filename_eq(&x.path, filename)) { if !apps.iter().any(|x| filename_eq(&x.path, filename)) {
if let Some(app) = if let Some(app) = all_apps.find(|x| filename_eq(&x.path, filename))
all_apps.find(|x| filename_eq(&x.path, filename))
{ {
apps.push(MimeApp::from(&app)); apps.push(MimeApp::from(&app));
} else { } else {