mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-24 16:51:19 +01:00
Make progress on showing favicons in the source list.
This commit is contained in:
parent
4cf3f8dfe7
commit
f7e3a4e914
@ -122,7 +122,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
|
||||
|
||||
currentTheme = themeLoader.defaultTheme
|
||||
|
||||
let faviconsFolder = RSDataSubfolder(nil, "Accounts")!
|
||||
let faviconsFolder = RSDataSubfolder(nil, "Favicons")!
|
||||
faviconDownloader = FaviconDownloader(folder: faviconsFolder)
|
||||
|
||||
let todayFeed = SmartFeed(delegate: TodayFeedDelegate())
|
||||
|
@ -428,9 +428,9 @@
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ocU-b4-EaY">
|
||||
<rect key="frame" x="3" y="0.0" width="17" height="17"/>
|
||||
<rect key="frame" x="0.0" y="-3" width="23" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" imageScaling="proportionallyDown" id="UzL-Uv-Vhz"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" imageScaling="proportionallyUpOrDown" id="UzL-Uv-Vhz"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fst-vi-Wue" userLabel="Text field">
|
||||
<rect key="frame" x="25" y="0.0" width="120" height="17"/>
|
||||
|
@ -13,13 +13,18 @@ private var textSizeCache = [String: NSSize]()
|
||||
|
||||
class SidebarCell : NSTableCellView {
|
||||
|
||||
var image: NSImage?
|
||||
var image: NSImage? {
|
||||
didSet {
|
||||
imageView?.image = shouldShowImage ? image : nil
|
||||
}
|
||||
}
|
||||
|
||||
var shouldShowImage = false {
|
||||
didSet {
|
||||
if shouldShowImage != oldValue {
|
||||
needsLayout = true
|
||||
}
|
||||
imageView?.image = shouldShowImage ? image : nil
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,10 +336,10 @@ private extension SidebarViewController {
|
||||
|
||||
func imageFor(_ node: Node) -> NSImage? {
|
||||
|
||||
// if let feed = node.representedObject as? Feed {
|
||||
//
|
||||
// }
|
||||
return nil
|
||||
guard let feed = node.representedObject as? Feed else {
|
||||
return nil
|
||||
}
|
||||
return appDelegate.faviconDownloader.favicon(for: feed)
|
||||
}
|
||||
|
||||
func nameFor(_ node: Node) -> String {
|
||||
|
Loading…
Reference in New Issue
Block a user