Skip to content

Commit

Permalink
Merge branch 'mac-candidate' of https://github.com/Ranchero-Software/…
Browse files Browse the repository at this point in the history
…NetNewsWire into mac-candidate
  • Loading branch information
brentsimmons committed Mar 6, 2021
2 parents 4abd53b + a7abde0 commit f8ae8d2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions Mac/MainWindow/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ final class IconView: NSView {

if NSApplication.shared.effectiveAppearance.isDarkMode {
if self.iconImage?.isDark ?? false {
self.isDisconcernable = false
self.isDiscernable = false
} else {
self.isDisconcernable = true
self.isDiscernable = true
}
} else {
if self.iconImage?.isBright ?? false {
self.isDisconcernable = false
self.isDiscernable = false
} else {
self.isDisconcernable = true
self.isDiscernable = true
}
}

Expand All @@ -35,7 +35,7 @@ final class IconView: NSView {
}
}

private var isDisconcernable = true
private var isDiscernable = true

override var isFlipped: Bool {
return true
Expand Down Expand Up @@ -85,7 +85,7 @@ final class IconView: NSView {

override func draw(_ dirtyRect: NSRect) {
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
color.set()
Expand Down
12 changes: 6 additions & 6 deletions Multiplatform/iOS/Article/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ final class IconView: UIView {

if self.traitCollection.userInterfaceStyle == .dark {
if self.iconImage?.isDark ?? false {
self.isDisconcernable = false
self.isDiscernable = false
self.setNeedsLayout()
} else {
self.isDisconcernable = true
self.isDiscernable = true
self.setNeedsLayout()
}
} else {
if self.iconImage?.isBright ?? false {
self.isDisconcernable = false
self.isDiscernable = false
self.setNeedsLayout()
} else {
self.isDisconcernable = true
self.isDiscernable = true
self.setNeedsLayout()
}
}
Expand All @@ -37,7 +37,7 @@ final class IconView: UIView {
}
}

private var isDisconcernable = true
private var isDiscernable = true

private let imageView: UIImageView = {
let imageView = UIImageView(image: AppAssets.faviconTemplateImage)
Expand Down Expand Up @@ -79,7 +79,7 @@ final class IconView: UIView {

override func layoutSubviews() {
imageView.setFrameIfNotEqual(rectForImageView())
if (iconImage != nil && isVerticalBackgroundExposed) || !isDisconcernable {
if (iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable {
backgroundColor = AppAssets.uiIconBackgroundColor
} else {
backgroundColor = nil
Expand Down
12 changes: 6 additions & 6 deletions Multiplatform/macOS/Article/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ final class IconView: NSView {

if NSApplication.shared.effectiveAppearance.isDarkMode {
if self.iconImage?.isDark ?? false {
self.isDisconcernable = false
self.isDiscernable = false
} else {
self.isDisconcernable = true
self.isDiscernable = true
}
} else {
if self.iconImage?.isBright ?? false {
self.isDisconcernable = false
self.isDiscernable = false
} else {
self.isDisconcernable = true
self.isDiscernable = true
}
}

Expand All @@ -35,7 +35,7 @@ final class IconView: NSView {
}
}

private var isDisconcernable = true
private var isDiscernable = true

override var isFlipped: Bool {
return true
Expand Down Expand Up @@ -81,7 +81,7 @@ final class IconView: NSView {
}

override func draw(_ dirtyRect: NSRect) {
guard hasExposedVerticalBackground || !isDisconcernable else {
guard hasExposedVerticalBackground || !isDiscernable else {
return
}

Expand Down
12 changes: 6 additions & 6 deletions iOS/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ final class IconView: UIView {

if self.traitCollection.userInterfaceStyle == .dark {
if self.iconImage?.isDark ?? false {
self.isDisconcernable = false
self.isDiscernable = false
self.setNeedsLayout()
} else {
self.isDisconcernable = true
self.isDiscernable = true
self.setNeedsLayout()
}
} else {
if self.iconImage?.isBright ?? false {
self.isDisconcernable = false
self.isDiscernable = false
self.setNeedsLayout()
} else {
self.isDisconcernable = true
self.isDiscernable = true
self.setNeedsLayout()
}
}
Expand All @@ -37,7 +37,7 @@ final class IconView: UIView {
}
}

private var isDisconcernable = true
private var isDiscernable = true

private let imageView: UIImageView = {
let imageView = NonIntrinsicImageView(image: AppAssets.faviconTemplateImage)
Expand Down Expand Up @@ -79,7 +79,7 @@ final class IconView: UIView {

override func layoutSubviews() {
imageView.setFrameIfNotEqual(rectForImageView())
if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDisconcernable) {
if !isBackgroundSuppressed && ((iconImage != nil && isVerticalBackgroundExposed) || !isDiscernable) {
backgroundColor = AppAssets.iconBackgroundColor
} else {
backgroundColor = nil
Expand Down

0 comments on commit f8ae8d2

Please sign in to comment.