From d49a0402eceda3c02f96afbc440610cbd0f3964a Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 4 Sep 2018 20:53:19 -0700 Subject: [PATCH] Manually set timeline text cell colors to white when selected and emphasized. (No need on Mojave.) Fix #413. --- .../Timeline/Cell/TimelineTableCellView.swift | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/NetNewsWire/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/NetNewsWire/MainWindow/Timeline/Cell/TimelineTableCellView.swift index 7584c1237..848864e1a 100644 --- a/NetNewsWire/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/NetNewsWire/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -189,22 +189,26 @@ private extension TimelineTableCellView { updateTitleView() + if #available(macOS 10.14, *) { + makeTextFieldColorsNormal() + } + else { + // Pre-Mojave: manually set colors to white when needed. + if isEmphasized && isSelected { + textFields.forEach { $0.textColor = NSColor.white } + } + else { + makeTextFieldColorsNormal() + } + } + } + + func makeTextFieldColorsNormal() { titleView.textColor = NSColor.labelColor feedNameView.textColor = NSColor.secondaryLabelColor dateView.textColor = NSColor.secondaryLabelColor summaryView.textColor = NSColor.secondaryLabelColor textView.textColor = NSColor.labelColor - -// if isEmphasized && isSelected { -// textFields.forEach { $0.textColor = NSColor.white } -// } -// else { -// feedNameView.textColor = cellAppearance.feedNameColor -// dateView.textColor = cellAppearance.dateColor -// titleView.textColor = cellAppearance.titleColor -// summaryView.textColor = cellAppearance.textColor -// textView.textColor = cellAppearance.textOnlyColor -// } } func updateTextFieldFonts() {