Format
This commit is contained in:
parent
7598130650
commit
4f8d22c120
2 changed files with 147 additions and 139 deletions
17
src/menu.rs
17
src/menu.rs
|
|
@ -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 {
|
||||||
|
|
@ -665,7 +674,7 @@ pub fn menu_bar<'a>(
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Message> {
|
pub fn location_context_menu<'a>(ancestor_index: usize) -> Element<'a, tab::Message> {
|
||||||
//TODO: only add some of these when in App mode
|
//TODO: only add some of these when in App mode
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue