Repo // Auto-expand candidate UI under certain conditions.
This commit is contained in:
parent
3d98e6d974
commit
2c132a4f92
|
@ -96,7 +96,8 @@ public class CtlCandidateTDK: CtlCandidate, NSWindowDelegate {
|
||||||
CandidateCellData.unifiedSize = candidateFont.pointSize
|
CandidateCellData.unifiedSize = candidateFont.pointSize
|
||||||
guard let delegate = delegate else { return }
|
guard let delegate = delegate else { return }
|
||||||
Self.thePool = .init(
|
Self.thePool = .init(
|
||||||
candidates: delegate.candidatePairs(conv: true), lines: maxLinesPerPage, isExpanded: false,
|
candidates: delegate.candidatePairs(conv: true), lines: maxLinesPerPage,
|
||||||
|
isExpanded: delegate.shouldAutoExpandCandidates,
|
||||||
selectionKeys: delegate.selectionKeys, layout: currentLayout.layoutTDK, locale: locale
|
selectionKeys: delegate.selectionKeys, layout: currentLayout.layoutTDK, locale: locale
|
||||||
)
|
)
|
||||||
Self.thePool.tooltip = tooltip
|
Self.thePool.tooltip = tooltip
|
||||||
|
|
|
@ -79,6 +79,12 @@ extension SessionCtl: InputHandlerDelegate {
|
||||||
|
|
||||||
extension SessionCtl: CtlCandidateDelegate {
|
extension SessionCtl: CtlCandidateDelegate {
|
||||||
public var isCandidateState: Bool { state.isCandidateContainer }
|
public var isCandidateState: Bool { state.isCandidateContainer }
|
||||||
|
|
||||||
|
public var shouldAutoExpandCandidates: Bool {
|
||||||
|
guard state.type == .ofSymbolTable else { return state.type == .ofAssociates }
|
||||||
|
return state.node.previous != nil
|
||||||
|
}
|
||||||
|
|
||||||
public var isCandidateContextMenuEnabled: Bool {
|
public var isCandidateContextMenuEnabled: Bool {
|
||||||
state.type == .ofCandidates && !clientBundleIdentifier.contains("com.apple.Spotlight")
|
state.type == .ofCandidates && !clientBundleIdentifier.contains("com.apple.Spotlight")
|
||||||
&& !clientBundleIdentifier.contains("com.raycast.macos")
|
&& !clientBundleIdentifier.contains("com.raycast.macos")
|
||||||
|
|
|
@ -19,6 +19,7 @@ public protocol CtlCandidateDelegate {
|
||||||
var selectionKeys: String { get }
|
var selectionKeys: String { get }
|
||||||
var isVerticalTyping: Bool { get }
|
var isVerticalTyping: Bool { get }
|
||||||
var isCandidateState: Bool { get }
|
var isCandidateState: Bool { get }
|
||||||
|
var shouldAutoExpandCandidates: Bool { get }
|
||||||
var isCandidateContextMenuEnabled: Bool { get }
|
var isCandidateContextMenuEnabled: Bool { get }
|
||||||
var showReverseLookupResult: Bool { get }
|
var showReverseLookupResult: Bool { get }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue