mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-23 15:50:26 +01:00
Added image luminescence processing to IconView so that pure white feed icons are visible. Issue #1731
This commit is contained in:
parent
5b5eaf6bb7
commit
cba00b6d45
@ -14,12 +14,29 @@ final class IconView: NSView {
|
|||||||
didSet {
|
didSet {
|
||||||
if iconImage !== oldValue {
|
if iconImage !== oldValue {
|
||||||
imageView.image = iconImage?.image
|
imageView.image = iconImage?.image
|
||||||
|
|
||||||
|
if NSApplication.shared.effectiveAppearance.isDarkMode {
|
||||||
|
if self.iconImage?.isDark ?? false {
|
||||||
|
self.isDisconcernable = false
|
||||||
|
} else {
|
||||||
|
self.isDisconcernable = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if self.iconImage?.isBright ?? false {
|
||||||
|
self.isDisconcernable = false
|
||||||
|
} else {
|
||||||
|
self.isDisconcernable = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
needsDisplay = true
|
needsDisplay = true
|
||||||
needsLayout = true
|
needsLayout = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var isDisconcernable = true
|
||||||
|
|
||||||
override var isFlipped: Bool {
|
override var isFlipped: Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -67,7 +84,7 @@ final class IconView: NSView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func draw(_ dirtyRect: NSRect) {
|
override func draw(_ dirtyRect: NSRect) {
|
||||||
guard hasExposedVerticalBackground else {
|
guard hasExposedVerticalBackground || !isDisconcernable else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user