Fix variable name

This commit is contained in:
Maurice Parker 2021-03-06 16:25:10 -06:00
parent 0fa4c02d63
commit a7abde04ab
4 changed files with 24 additions and 24 deletions

View File

@ -17,15 +17,15 @@ final class IconView: NSView {
if NSApplication.shared.effectiveAppearance.isDarkMode { if NSApplication.shared.effectiveAppearance.isDarkMode {
if self.iconImage?.isDark ?? false { if self.iconImage?.isDark ?? false {
self.isDisconcernable = false self.isDiscernable = false
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
} }
} else { } else {
if self.iconImage?.isBright ?? false { if self.iconImage?.isBright ?? false {
self.isDisconcernable = false self.isDiscernable = false
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
} }
} }
@ -35,7 +35,7 @@ final class IconView: NSView {
} }
} }
private var isDisconcernable = true private var isDiscernable = true
override var isFlipped: Bool { override var isFlipped: Bool {
return true return true
@ -85,7 +85,7 @@ final class IconView: NSView {
override func draw(_ dirtyRect: NSRect) { override func draw(_ dirtyRect: NSRect) {
guard !(iconImage?.isBackgroundSupressed ?? false) else { return } guard !(iconImage?.isBackgroundSupressed ?? false) else { return }
guard hasExposedVerticalBackground || !isDisconcernable else { return } guard hasExposedVerticalBackground || !isDiscernable else { return }
let color = NSApplication.shared.effectiveAppearance.isDarkMode ? IconView.darkBackgroundColor : IconView.lightBackgroundColor let color = NSApplication.shared.effectiveAppearance.isDarkMode ? IconView.darkBackgroundColor : IconView.lightBackgroundColor
color.set() color.set()

View File

@ -17,18 +17,18 @@ final class IconView: UIView {
if self.traitCollection.userInterfaceStyle == .dark { if self.traitCollection.userInterfaceStyle == .dark {
if self.iconImage?.isDark ?? false { if self.iconImage?.isDark ?? false {
self.isDisconcernable = false self.isDiscernable = false
self.setNeedsLayout() self.setNeedsLayout()
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
self.setNeedsLayout() self.setNeedsLayout()
} }
} else { } else {
if self.iconImage?.isBright ?? false { if self.iconImage?.isBright ?? false {
self.isDisconcernable = false self.isDiscernable = false
self.setNeedsLayout() self.setNeedsLayout()
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
self.setNeedsLayout() self.setNeedsLayout()
} }
} }
@ -37,7 +37,7 @@ final class IconView: UIView {
} }
} }
private var isDisconcernable = true private var isDiscernable = true
private let imageView: UIImageView = { private let imageView: UIImageView = {
let imageView = UIImageView(image: AppAssets.faviconTemplateImage) let imageView = UIImageView(image: AppAssets.faviconTemplateImage)
@ -79,7 +79,7 @@ final class IconView: UIView {
override func layoutSubviews() { override func layoutSubviews() {
imageView.setFrameIfNotEqual(rectForImageView()) imageView.setFrameIfNotEqual(rectForImageView())
if (iconImage != nil && isVerticalBackgroundExposed) || !isDisconcernable { if (iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable {
backgroundColor = AppAssets.uiIconBackgroundColor backgroundColor = AppAssets.uiIconBackgroundColor
} else { } else {
backgroundColor = nil backgroundColor = nil

View File

@ -17,15 +17,15 @@ final class IconView: NSView {
if NSApplication.shared.effectiveAppearance.isDarkMode { if NSApplication.shared.effectiveAppearance.isDarkMode {
if self.iconImage?.isDark ?? false { if self.iconImage?.isDark ?? false {
self.isDisconcernable = false self.isDiscernable = false
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
} }
} else { } else {
if self.iconImage?.isBright ?? false { if self.iconImage?.isBright ?? false {
self.isDisconcernable = false self.isDiscernable = false
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
} }
} }
@ -35,7 +35,7 @@ final class IconView: NSView {
} }
} }
private var isDisconcernable = true private var isDiscernable = true
override var isFlipped: Bool { override var isFlipped: Bool {
return true return true
@ -81,7 +81,7 @@ final class IconView: NSView {
} }
override func draw(_ dirtyRect: NSRect) { override func draw(_ dirtyRect: NSRect) {
guard hasExposedVerticalBackground || !isDisconcernable else { guard hasExposedVerticalBackground || !isDiscernable else {
return return
} }

View File

@ -17,18 +17,18 @@ final class IconView: UIView {
if self.traitCollection.userInterfaceStyle == .dark { if self.traitCollection.userInterfaceStyle == .dark {
if self.iconImage?.isDark ?? false { if self.iconImage?.isDark ?? false {
self.isDisconcernable = false self.isDiscernable = false
self.setNeedsLayout() self.setNeedsLayout()
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
self.setNeedsLayout() self.setNeedsLayout()
} }
} else { } else {
if self.iconImage?.isBright ?? false { if self.iconImage?.isBright ?? false {
self.isDisconcernable = false self.isDiscernable = false
self.setNeedsLayout() self.setNeedsLayout()
} else { } else {
self.isDisconcernable = true self.isDiscernable = true
self.setNeedsLayout() self.setNeedsLayout()
} }
} }
@ -37,7 +37,7 @@ final class IconView: UIView {
} }
} }
private var isDisconcernable = true private var isDiscernable = true
private let imageView: UIImageView = { private let imageView: UIImageView = {
let imageView = NonIntrinsicImageView(image: AppAssets.faviconTemplateImage) let imageView = NonIntrinsicImageView(image: AppAssets.faviconTemplateImage)
@ -79,7 +79,7 @@ final class IconView: UIView {
override func layoutSubviews() { override func layoutSubviews() {
imageView.setFrameIfNotEqual(rectForImageView()) imageView.setFrameIfNotEqual(rectForImageView())
if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDisconcernable) { if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable) {
backgroundColor = AppAssets.iconBackgroundColor backgroundColor = AppAssets.iconBackgroundColor
} else { } else {
backgroundColor = nil backgroundColor = nil