mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Updates PillButton appearance
This commit is contained in:
@@ -347,12 +347,10 @@ private extension AppViewController
|
||||
if self.app.installedApp == nil
|
||||
{
|
||||
button.setTitle(NSLocalizedString("FREE", comment: ""), for: .normal)
|
||||
button.isInverted = false
|
||||
}
|
||||
else
|
||||
{
|
||||
button.setTitle(NSLocalizedString("OPEN", comment: ""), for: .normal)
|
||||
button.isInverted = true
|
||||
}
|
||||
|
||||
let progress = AppManager.shared.installationProgress(for: self.app)
|
||||
|
||||
@@ -100,7 +100,6 @@ private extension BrowseViewController
|
||||
|
||||
let progress = AppManager.shared.installationProgress(for: app)
|
||||
cell.bannerView.button.progress = progress
|
||||
cell.bannerView.button.isInverted = false
|
||||
|
||||
if Date() < app.versionDate
|
||||
{
|
||||
@@ -115,7 +114,6 @@ private extension BrowseViewController
|
||||
{
|
||||
cell.bannerView.button.setTitle(NSLocalizedString("OPEN", comment: ""), for: .normal)
|
||||
cell.bannerView.button.progress = nil
|
||||
cell.bannerView.button.isInverted = true
|
||||
cell.bannerView.button.countdownDate = nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ class PillButton: UIButton
|
||||
let isUserInteractionEnabled = self.isUserInteractionEnabled
|
||||
self.isIndicatingActivity = (self.progress != nil)
|
||||
self.isUserInteractionEnabled = isUserInteractionEnabled
|
||||
|
||||
self.update()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +32,6 @@ class PillButton: UIButton
|
||||
}
|
||||
}
|
||||
|
||||
var isInverted: Bool = false {
|
||||
didSet {
|
||||
self.update()
|
||||
}
|
||||
}
|
||||
|
||||
var countdownDate: Date? {
|
||||
didSet {
|
||||
self.isEnabled = (self.countdownDate == nil)
|
||||
@@ -120,18 +116,18 @@ private extension PillButton
|
||||
{
|
||||
func update()
|
||||
{
|
||||
if self.isInverted
|
||||
if self.progress == nil
|
||||
{
|
||||
self.setTitleColor(.white, for: .normal)
|
||||
self.backgroundColor = self.tintColor
|
||||
self.progressView.progressTintColor = self.tintColor.withAlphaComponent(0.15)
|
||||
}
|
||||
else
|
||||
{
|
||||
self.setTitleColor(self.tintColor, for: .normal)
|
||||
self.backgroundColor = self.tintColor.withAlphaComponent(0.15)
|
||||
self.progressView.progressTintColor = self.tintColor
|
||||
}
|
||||
|
||||
self.progressView.progressTintColor = self.tintColor
|
||||
}
|
||||
|
||||
@objc func updateCountdown()
|
||||
|
||||
@@ -268,7 +268,6 @@ private extension MyAppsViewController
|
||||
cell.bannerView.iconImageView.isIndicatingActivity = true
|
||||
cell.bannerView.betaBadgeView.isHidden = !(installedApp.storeApp?.isBeta ?? false)
|
||||
|
||||
cell.bannerView.button.isInverted = true
|
||||
cell.bannerView.button.isIndicatingActivity = false
|
||||
cell.bannerView.button.addTarget(self, action: #selector(MyAppsViewController.refreshApp(_:)), for: .primaryActionTriggered)
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ private extension UpdateCollectionViewCell
|
||||
self.versionDescriptionTitleLabel.textColor = self.tintColor
|
||||
self.blurView.backgroundColor = self.tintColor
|
||||
|
||||
self.bannerView.button.isInverted = true
|
||||
self.bannerView.button.tintColor = self.tintColor
|
||||
self.bannerView.button.progressTintColor = self.tintColor
|
||||
|
||||
|
||||
@@ -344,7 +344,6 @@ extension NewsViewController
|
||||
|
||||
let progress = AppManager.shared.installationProgress(for: storeApp)
|
||||
footerView.bannerView.button.progress = progress
|
||||
footerView.bannerView.button.isInverted = false
|
||||
|
||||
if Date() < storeApp.versionDate
|
||||
{
|
||||
@@ -359,7 +358,6 @@ extension NewsViewController
|
||||
{
|
||||
footerView.bannerView.button.setTitle(NSLocalizedString("OPEN", comment: ""), for: .normal)
|
||||
footerView.bannerView.button.progress = nil
|
||||
footerView.bannerView.button.isInverted = true
|
||||
footerView.bannerView.button.countdownDate = nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user