TDKCandidates // Disallow filtering single kanjis through context menu.
This commit is contained in:
parent
a846fe48ac
commit
837bce78cf
|
@ -339,25 +339,29 @@ private extension VwrCandidateTDKCocoa {
|
|||
action: #selector(menuActionOfBoosting(_:)),
|
||||
keyEquivalent: ""
|
||||
)
|
||||
boostMenuItem.target = self
|
||||
newMenu.addItem(boostMenuItem)
|
||||
|
||||
let nerfMenuItem = NSMenuItem(
|
||||
title: "↓ \(cellData.displayedText)",
|
||||
action: #selector(menuActionOfNerfing(_:)),
|
||||
keyEquivalent: ""
|
||||
)
|
||||
nerfMenuItem.target = self
|
||||
newMenu.addItem(nerfMenuItem)
|
||||
|
||||
if let dataAll = (target as? VwrCandidateTDKCocoa)?.thePool.candidateDataAll,
|
||||
dataAll.count > cellData.index, dataAll[cellData.index].spanLength > 1
|
||||
{
|
||||
let filterMenuItem = NSMenuItem(
|
||||
title: "✖︎ \(cellData.displayedText)",
|
||||
action: #selector(menuActionOfFiltering(_:)),
|
||||
keyEquivalent: ""
|
||||
)
|
||||
|
||||
boostMenuItem.target = self
|
||||
nerfMenuItem.target = self
|
||||
filterMenuItem.target = self
|
||||
newMenu.addItem(boostMenuItem)
|
||||
newMenu.addItem(nerfMenuItem)
|
||||
newMenu.addItem(filterMenuItem)
|
||||
}
|
||||
|
||||
theMenu = newMenu
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,9 @@ extension VwrCandidateTDK {
|
|||
} label: {
|
||||
Text("↓ " + cell.displayedText)
|
||||
}
|
||||
if thePool.candidateDataAll.count > cell.index,
|
||||
thePool.candidateDataAll[cell.index].spanLength > 1
|
||||
{
|
||||
Button {
|
||||
didRightClickCandidateAt(cell.index, action: .toFilter)
|
||||
} label: {
|
||||
|
@ -176,6 +179,7 @@ extension VwrCandidateTDK {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func lineBackground(lineID: Int) -> Color {
|
||||
let isCurrentLineInMatrix = lineID == thePool.currentLineNumber && thePool.maxLinesPerPage != 1
|
||||
|
|
Loading…
Reference in New Issue