Show favicon in the timeline, even though they look weird because they’re small. They’re still better than nothing.

This commit is contained in:
Brent Simmons 2019-05-18 12:21:35 -07:00
parent 45d8bffe50
commit e98d28c770
1 changed files with 1 additions and 11 deletions

View File

@ -211,7 +211,6 @@ private extension TimelineTableCellView {
} }
func updateTextFieldText(_ textField: NSTextField, _ text: String?) { func updateTextFieldText(_ textField: NSTextField, _ text: String?) {
let s = text ?? "" let s = text ?? ""
if textField.stringValue != s { if textField.stringValue != s {
textField.stringValue = s textField.stringValue = s
@ -220,7 +219,6 @@ private extension TimelineTableCellView {
} }
func updateFeedNameView() { func updateFeedNameView() {
if cellData.showFeedName { if cellData.showFeedName {
showView(feedNameView) showView(feedNameView)
updateTextFieldText(feedNameView, cellData.feedName) updateTextFieldText(feedNameView, cellData.feedName)
@ -231,19 +229,15 @@ private extension TimelineTableCellView {
} }
func updateUnreadIndicator() { func updateUnreadIndicator() {
showOrHideView(unreadIndicatorView, cellData.read || cellData.starred) showOrHideView(unreadIndicatorView, cellData.read || cellData.starred)
} }
func updateStarView() { func updateStarView() {
showOrHideView(starView, !cellData.starred) showOrHideView(starView, !cellData.starred)
} }
func updateAvatar() { func updateAvatar() {
guard let image = cellData.avatar, cellData.showAvatar else {
// The avatar should be bigger than a favicon. Theyre too small; they look weird.
guard let image = cellData.avatar, cellData.showAvatar, image.size.height >= 22.0, image.size.width >= 22.0 else {
makeAvatarEmpty() makeAvatarEmpty()
return return
} }
@ -256,7 +250,6 @@ private extension TimelineTableCellView {
} }
func makeAvatarEmpty() { func makeAvatarEmpty() {
if avatarImageView.image != nil { if avatarImageView.image != nil {
avatarImageView.image = nil avatarImageView.image = nil
needsLayout = true needsLayout = true
@ -265,21 +258,18 @@ private extension TimelineTableCellView {
} }
func hideView(_ view: NSView) { func hideView(_ view: NSView) {
if !view.isHidden { if !view.isHidden {
view.isHidden = true view.isHidden = true
} }
} }
func showView(_ view: NSView) { func showView(_ view: NSView) {
if view.isHidden { if view.isHidden {
view.isHidden = false view.isHidden = false
} }
} }
func showOrHideView(_ view: NSView, _ shouldHide: Bool) { func showOrHideView(_ view: NSView, _ shouldHide: Bool) {
shouldHide ? hideView(view) : showView(view) shouldHide ? hideView(view) : showView(view)
} }