Files
NetNewsWire/Shared/TimelineThumbnailsDisplay.swift
T

44 lines
1013 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// TimelineThumbnailsDisplay.swift
// NetNewsWire
//
// Created by Brent Simmons on 10/26/26.
//
import Foundation
import Images
extension Notification.Name {
static let timelineThumbnailsDisplayDidChange = Notification.Name("TimelineThumbnailsDisplayDidChangeNotification")
}
/// How article thumbnails are shown in the timeline.
enum TimelineThumbnailsDisplay: Int, CaseIterable, CustomStringConvertible {
case none = 0 // Also what integer(forKey:) returns for a missing value
case small = 1 // To the right of the text
case large = 2 // Below the text, spanning the cell
var description: String {
switch self {
case .small:
NSLocalizedString("Small", comment: "Small")
case .large:
NSLocalizedString("Large", comment: "Large")
case .none:
NSLocalizedString("None", comment: "None")
}
}
/// Nil when the timeline doesn’t show thumbnails.
var thumbnailMode: ThumbnailMode? {
switch self {
case .small:
.small
case .large:
.large
case .none:
nil
}
}
}