feat: add empty-trash action to trash view context menu

Right-clicking inside the trash view now shows 'Empty trash' when
the trash is not empty, in addition to the existing per-item
restore/delete actions and sort options.
This commit is contained in:
Lionel DARNIS 2026-07-25 22:54:15 +02:00
parent 30e562c8c2
commit 9e0c2726ef

View file

@ -418,6 +418,12 @@ pub fn context_menu<'a>(
if tab.mode.multiple() { if tab.mode.multiple() {
children.push(menu_item(fl!("select-all"), Action::SelectAll).into()); children.push(menu_item(fl!("select-all"), Action::SelectAll).into());
} }
if !Trash::is_empty() {
if !children.is_empty() {
children.push(divider::horizontal::light().into());
}
children.push(menu_item(fl!("empty-trash"), Action::EmptyTrash).into());
}
if !children.is_empty() { if !children.is_empty() {
children.push(divider::horizontal::light().into()); children.push(divider::horizontal::light().into());
} }