From 787bbd5c0fe845183dcb765ecd3ab8c43cd2c99f Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Sun, 26 Nov 2023 16:56:44 +0800 Subject: [PATCH] TDKCandidates // Patch the bgColor of the current candidate line. --- .../TDKCandidates/VwrCandidateTDK_Appkit.swift | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateTDK_Appkit.swift b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateTDK_Appkit.swift index 4064777f..6cc99ce3 100644 --- a/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateTDK_Appkit.swift +++ b/Packages/vChewing_CandidateWindow/Sources/CandidateWindow/TDKCandidates/VwrCandidateTDK_Appkit.swift @@ -208,16 +208,7 @@ private extension VwrCandidateTDKAppKit { private extension VwrCandidateTDKAppKit { private func lineBackground(isCurrentLine: Bool, isMatrix: Bool) -> NSColor { - if !isCurrentLine { return .clear } - let absBg: NSColor = NSApplication.isDarkMode ? .black : .white - switch thePool.layout { - case .horizontal where isMatrix: - return NSApplication.isDarkMode ? .controlTextColor.withAlphaComponent(0.05) : .white - case .vertical where isMatrix: - return absBg.withAlphaComponent(0.9) - default: - return .clear - } + (isCurrentLine && isMatrix) ? (NSApplication.isDarkMode ? .controlTextColor.withAlphaComponent(0.05) : .white) : .clear } private var finalContainerOrientation: NSUserInterfaceLayoutOrientation {