add option to copy path when pressing down shift

This commit is contained in:
Frederic Laing 2025-11-12 22:18:53 +01:00 committed by Frederic Laing
parent f1a8e4ea19
commit 4e77e398f2
No known key found for this signature in database
GPG key ID: C126157F0CDCD306
4 changed files with 22 additions and 2 deletions

View file

@ -174,7 +174,11 @@ pub fn context_menu<'a>(
children.push(divider::horizontal::light().into());
children.push(menu_item(fl!("rename"), Action::Rename).into());
children.push(menu_item(fl!("cut"), Action::Cut).into());
children.push(menu_item(fl!("copy"), Action::Copy).into());
if modifiers.shift() && !modifiers.control() {
children.push(menu_item(fl!("copy-path"), Action::CopyPath).into());
} else {
children.push(menu_item(fl!("copy"), Action::Copy).into());
}
// Should this simply bypass trash and remove the shortcut?
children.push(menu_item(fl!("move-to-trash"), Action::Delete).into());
} else if selected > 0 {
@ -204,7 +208,11 @@ pub fn context_menu<'a>(
children.push(menu_item(fl!("rename"), Action::Rename).into());
children.push(menu_item(fl!("cut"), Action::Cut).into());
}
children.push(menu_item(fl!("copy"), Action::Copy).into());
if modifiers.shift() && !modifiers.control() {
children.push(menu_item(fl!("copy-path"), Action::CopyPath).into());
} else {
children.push(menu_item(fl!("copy"), Action::Copy).into());
}
if selected_mount_point == 0 {
children.push(menu_item(fl!("move-to"), Action::MoveTo).into());
}