mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 09:18:18 +00:00
Add setting to fade read articles in timeline on Mac.
This commit is contained in:
1 parent
bf01d58e4d
commit
128b727f42
6 files changed
+131
-34
No files matched your search
@@ -263,6 +263,14 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||
}
|
||||
}
|
||||
}
|
||||
private var fadesReadArticles = AppDefaults.timelineFadeReadArticles {
|
||||
didSet {
|
||||
if fadesReadArticles != oldValue {
|
||||
reloadVisibleCells()
|
||||
}
|
||||
}
|
||||
}
|
||||
private static let readArticleAlphaValue: CGFloat = 0.6
|
||||
|
||||
private struct ArticleIdentityKey: Equatable {
|
||||
let accountID: String
|
||||
@@ -296,6 +304,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||
textSize = AppDefaults.timelineTextSize
|
||||
numberOfLines = AppDefaults.timelineNumberOfLines
|
||||
showFullTitles = AppDefaults.timelineShowFullTitles
|
||||
fadesReadArticles = AppDefaults.timelineFadeReadArticles
|
||||
updateGridStyle()
|
||||
thumbnailsDisplay = AppDefaults.timelineThumbnailsDisplay
|
||||
updateCellAppearances()
|
||||
@@ -334,6 +343,7 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineTextSizeDidChange(_:)), name: .timelineTextSizeDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineNumberOfLinesDidChange(_:)), name: .timelineNumberOfLinesDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineShowFullTitlesDidChange(_:)), name: .timelineShowFullTitlesDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineFadeReadArticlesDidChange(_:)), name: .timelineFadeReadArticlesDidChange, object: nil)
|
||||
didRegisterForNotifications = true
|
||||
}
|
||||
|
||||
@@ -845,6 +855,10 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr
|
||||
showFullTitles = AppDefaults.timelineShowFullTitles
|
||||
}
|
||||
|
||||
@objc func handleTimelineFadeReadArticlesDidChange(_ notification: Notification) {
|
||||
fadesReadArticles = AppDefaults.timelineFadeReadArticles
|
||||
}
|
||||
|
||||
@objc func handleTimelineIconSizeDidChange(_ notification: Notification) {
|
||||
updateCellAppearances()
|
||||
rowHeights.removeAll()
|
||||
@@ -1296,10 +1310,14 @@ extension TimelineViewController: NSTableViewDelegate {
|
||||
private static let timelineCellIdentifier = NSUserInterfaceItemIdentifier(rawValue: "timelineCell")
|
||||
|
||||
func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
|
||||
if layout == .column {
|
||||
return columnCellView(for: tableColumn, row: row)
|
||||
let cellView = layout == .column ? columnCellView(for: tableColumn, row: row) : standardCellView(for: row)
|
||||
if let cellView {
|
||||
applyReadFading(to: cellView, row: row)
|
||||
}
|
||||
return cellView
|
||||
}
|
||||
|
||||
private func standardCellView(for row: Int) -> NSView {
|
||||
func configure(_ cell: TimelineTableCellView) {
|
||||
cell.cellAppearance = showIcons ? cellAppearanceWithIcon : cellAppearance
|
||||
if let article = articles.articleAtRow(row) {
|
||||
@@ -1325,6 +1343,8 @@ extension TimelineViewController: NSTableViewDelegate {
|
||||
}
|
||||
|
||||
func tableViewSelectionDidChange(_ notification: Notification) {
|
||||
applyReadFadingToAvailableRows()
|
||||
|
||||
if selectedArticles.isEmpty {
|
||||
selectionDidChange(nil)
|
||||
return
|
||||
@@ -1365,6 +1385,29 @@ extension TimelineViewController: NSTableViewDelegate {
|
||||
cell.cellData = TimelineCellData(article: article, showFeedName: showFeedNames, feedName: article.feed?.nameForDisplay, byline: article.byline(), iconImage: iconImage, showIcon: showIcons, thumbnail: thumbnail, showThumbnail: showThumbnail)
|
||||
}
|
||||
|
||||
/// Fades the cell views, not the row view, so the selection highlight and separators stay full strength.
|
||||
/// The selected row never fades, since selecting an article marks it read.
|
||||
private func applyReadFading(to cellView: NSView, row: Int) {
|
||||
var alphaValue: CGFloat = 1.0
|
||||
if fadesReadArticles, let article = articles.articleAtRow(row), article.status.read, !tableView.isRowSelected(row) {
|
||||
alphaValue = Self.readArticleAlphaValue
|
||||
}
|
||||
if cellView.alphaValue != alphaValue {
|
||||
cellView.alphaValue = alphaValue
|
||||
}
|
||||
}
|
||||
|
||||
/// Selection changes don’t reload cells.
|
||||
private func applyReadFadingToAvailableRows() {
|
||||
tableView.enumerateAvailableRowViews { rowView, row in
|
||||
for column in 0..<rowView.numberOfColumns {
|
||||
if let cellView = rowView.view(atColumn: column) as? NSView {
|
||||
applyReadFading(to: cellView, row: row)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func makeTimelineCellEmpty(_ cell: TimelineTableCellView) {
|
||||
cell.objectValue = nil
|
||||
cell.cellData = TimelineCellData()
|
||||
|
||||
@@ -27,6 +27,7 @@ final class AppearancePreferencesViewController: NSViewController {
|
||||
@IBOutlet var timelineThumbnailsPopup: NSPopUpButton?
|
||||
@IBOutlet var timelineTextSizePopup: NSPopUpButton?
|
||||
@IBOutlet var timelineShowSeparatorsButton: NSButton?
|
||||
@IBOutlet var timelineFadeReadArticlesButton: NSButton?
|
||||
|
||||
@IBOutlet var articleTextSizeLabel: NSTextField?
|
||||
@IBOutlet var articleTextSizePopup: NSPopUpButton?
|
||||
@@ -64,6 +65,7 @@ final class AppearancePreferencesViewController: NSViewController {
|
||||
updateTimelineTextSizePopup()
|
||||
updateTimelineRowsControls()
|
||||
updateTimelineShowSeparatorsButton()
|
||||
updateTimelineFadeReadArticlesButton()
|
||||
updateArticleThemePopup()
|
||||
}
|
||||
|
||||
@@ -121,6 +123,10 @@ final class AppearancePreferencesViewController: NSViewController {
|
||||
updateTimelineShowSeparatorsButton()
|
||||
}
|
||||
|
||||
@objc func handleTimelineFadeReadArticlesDidChange(_ notification: Notification) {
|
||||
updateTimelineFadeReadArticlesButton()
|
||||
}
|
||||
|
||||
// MARK: - Actions
|
||||
|
||||
@IBAction func appearancePopUpDidChange(_ sender: Any) {
|
||||
@@ -196,6 +202,10 @@ final class AppearancePreferencesViewController: NSViewController {
|
||||
AppDefaults.timelineShowSeparators = sender.state == .on
|
||||
}
|
||||
|
||||
@IBAction func timelineFadeReadArticlesDidChange(_ sender: NSButton) {
|
||||
AppDefaults.timelineFadeReadArticles = sender.state == .on
|
||||
}
|
||||
|
||||
@IBAction func showThemesFolder(_ sender: Any) {
|
||||
let url = URL(fileURLWithPath: ArticleThemesManager.shared.folderPath)
|
||||
NSWorkspace.shared.open(url)
|
||||
@@ -228,6 +238,7 @@ private extension AppearancePreferencesViewController {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineNumberOfLinesDidChange(_:)), name: .timelineNumberOfLinesDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineShowFullTitlesDidChange(_:)), name: .timelineShowFullTitlesDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineShowSeparatorsDidChange(_:)), name: .timelineShowSeparatorsDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleTimelineFadeReadArticlesDidChange(_:)), name: .timelineFadeReadArticlesDidChange, object: nil)
|
||||
}
|
||||
|
||||
/// On macOS 15 the "Article Text Size:" label is vertically misaligned
|
||||
@@ -308,6 +319,10 @@ private extension AppearancePreferencesViewController {
|
||||
timelineShowSeparatorsButton?.state = AppDefaults.timelineShowSeparators ? .on : .off
|
||||
}
|
||||
|
||||
func updateTimelineFadeReadArticlesButton() {
|
||||
timelineFadeReadArticlesButton?.state = AppDefaults.timelineFadeReadArticles ? .on : .off
|
||||
}
|
||||
|
||||
func updateArticleThemePopup() {
|
||||
guard let articleThemePopup, let menu = articleThemePopup.menu else {
|
||||
return
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<outlet property="sidebarTextSizePopup" destination="sbP-tX-0p1" id="sbO-tX-0o1"/>
|
||||
<outlet property="timelineIconSizePopup" destination="tlP-fS-0p1" id="tlO-fS-0o1"/>
|
||||
<outlet property="timelineIconsPopup" destination="tlP-fD-0p1" id="tlO-fD-0o1"/>
|
||||
<outlet property="timelineFadeReadArticlesButton" destination="tlB-fR-0b1" id="tlO-fR-0o1"/>
|
||||
<outlet property="timelineFullTitlesButton" destination="tlR-fT-0b1" id="tlO-fT-0o1"/>
|
||||
<outlet property="timelineNumberOfLinesPopup" destination="tlP-nL-0p1" id="tlO-nL-0o1"/>
|
||||
<outlet property="timelineShowSeparatorsButton" destination="tlB-sP-0b1" id="tlO-sP-0o1"/>
|
||||
@@ -30,14 +31,14 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<view id="apV-iw-0v1">
|
||||
<rect key="frame" x="0.0" y="0.0" width="515" height="745"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="515" height="767"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="apC-nT-0c1">
|
||||
<rect key="frame" x="55" y="20" width="406" height="705"/>
|
||||
<rect key="frame" x="55" y="20" width="406" height="727"/>
|
||||
<subviews>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="apL-cM-0l1">
|
||||
<rect key="frame" x="-2" y="685" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="707" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Appearance:" id="apL-cM-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -45,7 +46,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="apP-cM-0p1">
|
||||
<rect key="frame" x="155" y="681" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="703" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="System" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="apM-cM-0m0" id="apP-cM-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -66,10 +67,10 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="sp1-Bx-0s1">
|
||||
<rect key="frame" x="0.0" y="658" width="405" height="5"/>
|
||||
<rect key="frame" x="0.0" y="680" width="405" height="5"/>
|
||||
</box>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbL-fI-0l1">
|
||||
<rect key="frame" x="-2" y="624" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="646" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Sidebar Icons:" id="sbL-fI-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -77,7 +78,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbB-fI-0b1">
|
||||
<rect key="frame" x="155" y="624" width="251" height="16"/>
|
||||
<rect key="frame" x="155" y="646" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="Show" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="sbB-fI-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -87,7 +88,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbL-tX-0l1">
|
||||
<rect key="frame" x="-2" y="592" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="614" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Sidebar Text Size:" id="sbL-tX-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -95,7 +96,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbP-tX-0p1">
|
||||
<rect key="frame" x="155" y="588" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="610" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="System" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="sbM-tX-0m0" id="sbP-tX-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -119,7 +120,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbL-sF-0l1">
|
||||
<rect key="frame" x="-2" y="560" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="582" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Smart Feeds:" id="sbL-sF-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -127,7 +128,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbB-tD-0b1">
|
||||
<rect key="frame" x="155" y="560" width="251" height="16"/>
|
||||
<rect key="frame" x="155" y="582" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="Today" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="sbB-tD-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -137,7 +138,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbB-aU-0b1">
|
||||
<rect key="frame" x="155" y="538" width="251" height="16"/>
|
||||
<rect key="frame" x="155" y="560" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="All Unread" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="sbB-aU-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -147,7 +148,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sbB-sT-0b1">
|
||||
<rect key="frame" x="155" y="516" width="251" height="16"/>
|
||||
<rect key="frame" x="155" y="538" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="Starred" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="sbB-sT-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -157,10 +158,10 @@
|
||||
</connections>
|
||||
</button>
|
||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="sp2-Bx-0s1">
|
||||
<rect key="frame" x="0.0" y="493" width="405" height="5"/>
|
||||
<rect key="frame" x="0.0" y="515" width="405" height="5"/>
|
||||
</box>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-fI-0l1">
|
||||
<rect key="frame" x="-2" y="455" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="477" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Timeline Feed Icons:" id="tlL-fI-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -168,7 +169,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlP-fD-0p1">
|
||||
<rect key="frame" x="155" y="451" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="473" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Automatic" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="tlM-fD-0m0" id="tlP-fD-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -185,7 +186,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tlN-fD-0l1">
|
||||
<rect key="frame" x="153" y="411" width="255" height="32"/>
|
||||
<rect key="frame" x="153" y="433" width="255" height="32"/>
|
||||
<textFieldCell key="cell" controlSize="small" title="Automatic shows icons for folders, smart feeds, and authors with avatars." id="tlN-fD-0c1">
|
||||
<font key="font" usesAppearanceFont="YES"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -193,7 +194,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-fS-0l1">
|
||||
<rect key="frame" x="-2" y="379" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="401" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Timeline Feed Icon Size:" id="tlL-fS-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -201,7 +202,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlP-fS-0p1">
|
||||
<rect key="frame" x="155" y="375" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="397" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Medium" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2" imageScaling="proportionallyDown" inset="2" selectedItem="tlM-fS-0m2" id="tlP-fS-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -218,7 +219,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-tH-0l1">
|
||||
<rect key="frame" x="-2" y="343" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="365" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Thumbnails:" id="tlL-tH-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -226,7 +227,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlP-tS-0p1">
|
||||
<rect key="frame" x="155" y="339" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="361" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="None" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="tlM-tS-0m0" id="tlP-tS-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -244,7 +245,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-tX-0l1">
|
||||
<rect key="frame" x="-2" y="307" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="329" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Timeline Text Size:" id="tlL-tX-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -252,7 +253,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlP-tX-0p1">
|
||||
<rect key="frame" x="155" y="303" width="250" height="24"/>
|
||||
<rect key="frame" x="155" y="325" width="250" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Medium" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2" imageScaling="proportionallyDown" inset="2" selectedItem="tlM-tX-0m2" id="tlP-tX-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -274,7 +275,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-nL-0l1">
|
||||
<rect key="frame" x="-2" y="271" width="151" height="16"/>
|
||||
<rect key="frame" x="-2" y="293" width="151" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Timeline Rows:" id="tlL-nL-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -282,7 +283,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlP-nL-0p1">
|
||||
<rect key="frame" x="306" y="267" width="57" height="24"/>
|
||||
<rect key="frame" x="306" y="289" width="57" height="24"/>
|
||||
<popUpButtonCell key="cell" type="push" title="2" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="2" imageScaling="proportionallyDown" inset="2" selectedItem="tlM-nL-0m2" id="tlP-nL-0c1">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="message"/>
|
||||
@@ -302,7 +303,7 @@
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlR-tP-0b1">
|
||||
<rect key="frame" x="155" y="271" width="143" height="16"/>
|
||||
<rect key="frame" x="155" y="293" width="143" height="16"/>
|
||||
<buttonCell key="cell" type="radio" title="Title and preview, in" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="tlR-tP-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -312,7 +313,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlL-ln-0l1">
|
||||
<rect key="frame" x="369" y="271" width="32" height="16"/>
|
||||
<rect key="frame" x="369" y="293" width="32" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="lines" id="tlL-ln-0c1">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -320,7 +321,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlR-fT-0b1">
|
||||
<rect key="frame" x="155" y="243" width="144" height="16"/>
|
||||
<rect key="frame" x="155" y="265" width="144" height="16"/>
|
||||
<buttonCell key="cell" type="radio" title="Full title, no preview" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="tlR-fT-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -330,7 +331,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tlN-fT-0l1">
|
||||
<rect key="frame" x="173" y="221" width="235" height="16"/>
|
||||
<rect key="frame" x="173" y="243" width="235" height="16"/>
|
||||
<textFieldCell key="cell" controlSize="small" title="Shows the whole title, up to 12 lines." id="tlN-fT-0c1">
|
||||
<font key="font" usesAppearanceFont="YES"/>
|
||||
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -338,7 +339,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlB-sP-0b1">
|
||||
<rect key="frame" x="155" y="193" width="251" height="16"/>
|
||||
<rect key="frame" x="155" y="215" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="Show separators" bezelStyle="regularSquare" imagePosition="left" inset="2" id="tlB-sP-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -347,6 +348,16 @@
|
||||
<action selector="timelineShowSeparatorsDidChange:" target="-2" id="tlA-sP-0a1"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tlB-fR-0b1">
|
||||
<rect key="frame" x="155" y="193" width="251" height="16"/>
|
||||
<buttonCell key="cell" type="check" title="Fade read articles" bezelStyle="regularSquare" imagePosition="left" inset="2" id="tlB-fR-0c1">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="timelineFadeReadArticlesDidChange:" target="-2" id="tlA-fR-0a1"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" translatesAutoresizingMaskIntoConstraints="NO" id="tlN-cL-0l1">
|
||||
<rect key="frame" x="153" y="137" width="255" height="48"/>
|
||||
<textFieldCell key="cell" controlSize="small" title="Feed icon size, thumbnails, timeline rows, and separators apply only to the standard layout." id="tlN-cL-0c1">
|
||||
@@ -514,7 +525,10 @@
|
||||
<constraint firstItem="tlB-sP-0b1" firstAttribute="top" secondItem="tlN-fT-0l1" secondAttribute="bottom" constant="12" id="c69-Ly-Out"/>
|
||||
<constraint firstItem="tlB-sP-0b1" firstAttribute="leading" secondItem="apP-cM-0p1" secondAttribute="leading" id="c70-Ly-Out"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tlB-sP-0b1" secondAttribute="trailing" id="c71-Ly-Out"/>
|
||||
<constraint firstItem="tlN-cL-0l1" firstAttribute="top" secondItem="tlB-sP-0b1" secondAttribute="bottom" constant="8" id="cN1-Ly-Out"/>
|
||||
<constraint firstItem="tlB-fR-0b1" firstAttribute="top" secondItem="tlB-sP-0b1" secondAttribute="bottom" constant="6" id="cF1-Ly-Out"/>
|
||||
<constraint firstItem="tlB-fR-0b1" firstAttribute="leading" secondItem="apP-cM-0p1" secondAttribute="leading" id="cF2-Ly-Out"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tlB-fR-0b1" secondAttribute="trailing" id="cF3-Ly-Out"/>
|
||||
<constraint firstItem="tlN-cL-0l1" firstAttribute="top" secondItem="tlB-fR-0b1" secondAttribute="bottom" constant="8" id="cN1-Ly-Out"/>
|
||||
<constraint firstItem="tlN-cL-0l1" firstAttribute="leading" secondItem="apP-cM-0p1" secondAttribute="leading" id="cN2-Ly-Out"/>
|
||||
<constraint firstAttribute="trailing" secondItem="tlN-cL-0l1" secondAttribute="trailing" id="cN3-Ly-Out"/>
|
||||
<constraint firstItem="sp3-Bx-0s1" firstAttribute="top" secondItem="tlN-cL-0l1" secondAttribute="bottom" constant="20" id="c72-Ly-Out"/>
|
||||
|
||||
@@ -325,6 +325,18 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"tlB-fR-0c1.title" : {
|
||||
"comment" : "Class = \"NSButtonCell\"; title = \"Fade read articles\"; ObjectID = \"tlB-fR-0c1\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "new",
|
||||
"value" : "Fade read articles"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"tlB-sP-0c1.title" : {
|
||||
"comment" : "Class = \"NSButtonCell\"; title = \"Show separators\"; ObjectID = \"tlB-sP-0c1\";",
|
||||
"extractionState" : "extracted_with_value",
|
||||
|
||||
@@ -35,6 +35,7 @@ enum AppDefaults {
|
||||
static let timelineTextSize = "timelineTextSize"
|
||||
static let timelineNumberOfLines = "timelineNumberOfLines"
|
||||
static let timelineShowFullTitles = "timelineShowFullTitles"
|
||||
static let timelineFadeReadArticles = "timelineFadeReadArticles"
|
||||
}
|
||||
|
||||
/// Registered by both platforms. Each platform’s registerDefaults adds its own.
|
||||
@@ -53,7 +54,8 @@ enum AppDefaults {
|
||||
Key.showUnreadFeed: true,
|
||||
Key.showStarredFeed: true,
|
||||
Key.timelineTextSize: TimelineTextSize.medium.rawValue,
|
||||
Key.timelineShowFullTitles: false
|
||||
Key.timelineShowFullTitles: false,
|
||||
Key.timelineFadeReadArticles: false
|
||||
]
|
||||
}
|
||||
|
||||
@@ -249,6 +251,16 @@ enum AppDefaults {
|
||||
NotificationCenter.default.post(name: .timelineShowFullTitlesDidChange, object: nil)
|
||||
}
|
||||
}
|
||||
|
||||
static var timelineFadeReadArticles: Bool {
|
||||
get {
|
||||
UserDefaults.standard.bool(forKey: Key.timelineFadeReadArticles)
|
||||
}
|
||||
set {
|
||||
UserDefaults.standard.set(newValue, forKey: Key.timelineFadeReadArticles)
|
||||
NotificationCenter.default.post(name: .timelineFadeReadArticlesDidChange, object: nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
@@ -18,4 +18,5 @@ extension Notification.Name {
|
||||
static let timelineIconSizeDidChange = Notification.Name("TimelineIconSizeDidChangeNotification")
|
||||
static let timelineNumberOfLinesDidChange = Notification.Name("TimelineNumberOfLinesDidChangeNotification")
|
||||
static let timelineShowFullTitlesDidChange = Notification.Name("TimelineShowFullTitlesDidChangeNotification")
|
||||
static let timelineFadeReadArticlesDidChange = Notification.Name("TimelineFadeReadArticlesDidChangeNotification")
|
||||
}
|
||||
Reference in new issue
Block a user