diff --git a/src/menu.rs b/src/menu.rs index 4182e83..7c7c99f 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -2,7 +2,7 @@ use cosmic::{ app::Core, - iced::{Alignment, Background, Border, Length}, + iced::{keyboard::Modifiers, Alignment, Background, Border, Length}, theme, widget::{ self, button, column, container, divider, horizontal_space, @@ -55,6 +55,7 @@ fn menu_button_optional( pub fn context_menu<'a>( tab: &Tab, key_binds: &HashMap, + modifiers: &Modifiers, ) -> Element<'a, tab::Message> { let find_key = |action: &Action| -> String { for (key_bind, key_action) in key_binds.iter() { @@ -216,7 +217,13 @@ pub fn context_menu<'a>( children.push(menu_item(fl!("add-to-sidebar"), Action::AddToSidebar).into()); } children.push(divider::horizontal::light().into()); - children.push(menu_item(fl!("move-to-trash"), Action::Delete).into()); + if modifiers.shift() && !modifiers.control() { + children.push( + menu_item(fl!("delete-permanently"), Action::PermanentlyDelete).into(), + ); + } else { + children.push(menu_item(fl!("move-to-trash"), Action::Delete).into()); + } } else { //TODO: need better designs for menu with no selection //TODO: have things like properties but they apply to the folder? diff --git a/src/tab.rs b/src/tab.rs index 40c8901..825b247 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -4855,10 +4855,12 @@ impl Tab { let mut popover = widget::popover(mouse_area); if let Some(point) = self.context_menu { + let context_menu = menu::context_menu(self, key_binds, &self.modifiers); popover = popover - .popup(menu::context_menu(self, key_binds)) + .popup(context_menu) .position(widget::popover::Position::Point(point)); } + let mut tab_column = widget::column::with_capacity(3); if let Some(location_view) = location_view_opt { tab_column = tab_column.push(location_view);