ctlCandidate // Make page-handling keys @discardableResult.
This commit is contained in:
parent
15af0f74ef
commit
860289af46
|
@ -116,19 +116,19 @@ public class ctlCandidate: NSWindowController, ctlCandidateProtocol {
|
|||
|
||||
public func reloadData() {}
|
||||
|
||||
public func showNextPage() -> Bool {
|
||||
@discardableResult public func showNextPage() -> Bool {
|
||||
false
|
||||
}
|
||||
|
||||
public func showPreviousPage() -> Bool {
|
||||
@discardableResult public func showPreviousPage() -> Bool {
|
||||
false
|
||||
}
|
||||
|
||||
public func highlightNextCandidate() -> Bool {
|
||||
@discardableResult public func highlightNextCandidate() -> Bool {
|
||||
false
|
||||
}
|
||||
|
||||
public func highlightPreviousCandidate() -> Bool {
|
||||
@discardableResult public func highlightPreviousCandidate() -> Bool {
|
||||
false
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
|
|||
}
|
||||
|
||||
// 該函式會影響 IMK 選字窗。
|
||||
public func showNextPage() -> Bool {
|
||||
@discardableResult public func showNextPage() -> Bool {
|
||||
guard delegate != nil else { return false }
|
||||
if pageCount == 1 { return highlightNextCandidate() }
|
||||
if currentPageIndex + 1 >= pageCount { clsSFX.beep() }
|
||||
|
@ -135,7 +135,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
|
|||
}
|
||||
|
||||
// 該函式會影響 IMK 選字窗。
|
||||
public func showPreviousPage() -> Bool {
|
||||
@discardableResult public func showPreviousPage() -> Bool {
|
||||
guard delegate != nil else { return false }
|
||||
if pageCount == 1 { return highlightPreviousCandidate() }
|
||||
if currentPageIndex == 0 { clsSFX.beep() }
|
||||
|
@ -147,7 +147,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
|
|||
}
|
||||
|
||||
// 該函式會影響 IMK 選字窗。
|
||||
public func highlightNextCandidate() -> Bool {
|
||||
@discardableResult public func highlightNextCandidate() -> Bool {
|
||||
guard let delegate = delegate else { return false }
|
||||
selectedCandidateIndex =
|
||||
(selectedCandidateIndex + 1 >= delegate.candidateCountForController(self))
|
||||
|
@ -157,7 +157,7 @@ public class ctlCandidateIMK: IMKCandidates, ctlCandidateProtocol {
|
|||
}
|
||||
|
||||
// 該函式會影響 IMK 選字窗。
|
||||
public func highlightPreviousCandidate() -> Bool {
|
||||
@discardableResult public func highlightPreviousCandidate() -> Bool {
|
||||
guard let delegate = delegate else { return false }
|
||||
selectedCandidateIndex =
|
||||
(selectedCandidateIndex == 0)
|
||||
|
|
|
@ -432,7 +432,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
layoutCandidateView()
|
||||
}
|
||||
|
||||
override public func showNextPage() -> Bool {
|
||||
@discardableResult override public func showNextPage() -> Bool {
|
||||
guard delegate != nil else { return false }
|
||||
if pageCount == 1 { return highlightNextCandidate() }
|
||||
if currentPageIndex + 1 >= pageCount { clsSFX.beep() }
|
||||
|
@ -445,7 +445,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
return true
|
||||
}
|
||||
|
||||
override public func showPreviousPage() -> Bool {
|
||||
@discardableResult override public func showPreviousPage() -> Bool {
|
||||
guard delegate != nil else { return false }
|
||||
if pageCount == 1 { return highlightPreviousCandidate() }
|
||||
if currentPageIndex == 0 { clsSFX.beep() }
|
||||
|
@ -458,7 +458,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
return true
|
||||
}
|
||||
|
||||
override public func highlightNextCandidate() -> Bool {
|
||||
@discardableResult override public func highlightNextCandidate() -> Bool {
|
||||
guard let delegate = delegate else { return false }
|
||||
selectedCandidateIndex =
|
||||
(selectedCandidateIndex + 1 >= delegate.candidateCountForController(self))
|
||||
|
@ -466,7 +466,7 @@ public class ctlCandidateUniversal: ctlCandidate {
|
|||
return true
|
||||
}
|
||||
|
||||
override public func highlightPreviousCandidate() -> Bool {
|
||||
@discardableResult override public func highlightPreviousCandidate() -> Bool {
|
||||
guard let delegate = delegate else { return false }
|
||||
selectedCandidateIndex =
|
||||
(selectedCandidateIndex == 0)
|
||||
|
|
Loading…
Reference in New Issue