Add additional assets for Article Extractor Button for when the app is inactive.

This commit is contained in:
Maurice Parker 2019-11-12 13:05:52 -06:00
parent 701070f2dd
commit 0d2583948a
6 changed files with 41 additions and 1 deletions

View File

@ -50,6 +50,14 @@ struct AppAssets {
return RSImage(named: "articleExtractorError")
}()
static var articleExtractorInactiveDark: RSImage! = {
return RSImage(named: "articleExtractorInactiveDark")
}()
static var articleExtractorInactiveLight: RSImage! = {
return RSImage(named: "articleExtractorInactiveLight")
}()
static var articleExtractorProgress1: RSImage! = {
return RSImage(named: "articleExtractorProgress1")
}()

View File

@ -59,7 +59,15 @@ class ArticleExtractorButton: NSButton {
case isInProgress:
addAnimatedSublayer(to: hostedLayer)
default:
addImageSublayer(to: hostedLayer, image: AppAssets.articleExtractor, opacity: opacity)
if NSApplication.shared.isActive {
addImageSublayer(to: hostedLayer, image: AppAssets.articleExtractor, opacity: opacity)
} else {
if NSApplication.shared.effectiveAppearance.isDarkMode {
addImageSublayer(to: hostedLayer, image: AppAssets.articleExtractorInactiveDark, opacity: opacity)
} else {
addImageSublayer(to: hostedLayer, image: AppAssets.articleExtractorInactiveLight, opacity: opacity)
}
}
}
}

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ArticleExtractorInactiveDark.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ArticleExtractorInactiveLight.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}