From 395b4922e493fbb75256bc38fd46b69b66d8d7e8 Mon Sep 17 00:00:00 2001 From: Ada Alakbarova Date: Tue, 17 Feb 2026 23:00:17 +0100 Subject: [PATCH] fix: Remove inappropriate context menu options while in Recents It's not a regular folder, which means: - It can't be modified, so the following options are removed: - New file - New folder - Paste - It can't be opened as a folder, so the following options are removed: - Open in terminal --- src/menu.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/menu.rs b/src/menu.rs index 05a50bc..fe4aafa 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -247,14 +247,19 @@ pub fn context_menu<'a>( } else { //TODO: need better designs for menu with no selection //TODO: have things like properties but they apply to the folder? - children.push(menu_item(fl!("new-folder"), Action::NewFolder).into()); - children.push(menu_item(fl!("new-file"), Action::NewFile).into()); - children.push(menu_item(fl!("open-in-terminal"), Action::OpenTerminal).into()); - children.push(divider::horizontal::light().into()); + if tab.location != Location::Recents { + children.push(menu_item(fl!("new-folder"), Action::NewFolder).into()); + children.push(menu_item(fl!("new-file"), Action::NewFile).into()); + children.push(menu_item(fl!("open-in-terminal"), Action::OpenTerminal).into()); + children.push(divider::horizontal::light().into()); + } + if tab.mode.multiple() { children.push(menu_item(fl!("select-all"), Action::SelectAll).into()); } - children.push(menu_item(fl!("paste"), Action::Paste).into()); + if tab.location != Location::Recents { + children.push(menu_item(fl!("paste"), Action::Paste).into()); + } //TODO: only show if cosmic-settings is found? if matches!(tab.mode, tab::Mode::Desktop) {