macOS: Disable 'Delete Selected' when nothing is selected
This commit is contained in:
parent
3a1208836c
commit
1dca1022d5
|
@ -317,6 +317,15 @@ extension TunnelsListTableViewController {
|
|||
}
|
||||
}
|
||||
|
||||
extension TunnelsListTableViewController: NSMenuItemValidation {
|
||||
func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
|
||||
if menuItem.action == #selector(TunnelsListTableViewController.handleRemoveTunnelAction) {
|
||||
return !tableView.selectedRowIndexes.isEmpty
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
class FillerButton: NSButton {
|
||||
override var intrinsicContentSize: NSSize {
|
||||
return NSSize(width: NSView.noIntrinsicMetric, height: NSView.noIntrinsicMetric)
|
||||
|
|
Loading…
Reference in New Issue