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 {
|
||||
if iconImage !== oldValue {
|
||||
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
|
||||
needsLayout = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var isDisconcernable = true
|
||||
|
||||
override var isFlipped: Bool {
|
||||
return true
|
||||
}
|
||||
|
@ -67,7 +84,7 @@ final class IconView: NSView {
|
|||
}
|
||||
|
||||
override func draw(_ dirtyRect: NSRect) {
|
||||
guard hasExposedVerticalBackground else {
|
||||
guard hasExposedVerticalBackground || !isDisconcernable else {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue