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
This commit is contained in:
parent
eda673a258
commit
395b4922e4
1 changed files with 10 additions and 5 deletions
15
src/menu.rs
15
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue