project panel: Always show paste in context menu (and grey it out when it's disabled) (#17262)
 Release Notes: - "Paste" is now always shown in project panel context menu.
This commit is contained in:
parent
b578be5c77
commit
b6cf576d66
2 changed files with 53 additions and 8 deletions
|
@ -499,8 +499,12 @@ impl ProjectPanel {
|
|||
.action("Copy", Box::new(Copy))
|
||||
.action("Duplicate", Box::new(Duplicate))
|
||||
// TODO: Paste should always be visible, cbut disabled when clipboard is empty
|
||||
.when(self.clipboard.as_ref().is_some(), |menu| {
|
||||
menu.action("Paste", Box::new(Paste))
|
||||
.map(|menu| {
|
||||
if self.clipboard.as_ref().is_some() {
|
||||
menu.action("Paste", Box::new(Paste))
|
||||
} else {
|
||||
menu.disabled_action("Paste", Box::new(Paste))
|
||||
}
|
||||
})
|
||||
.separator()
|
||||
.action("Copy Path", Box::new(CopyPath))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue