Nicer toolbar buttons

This commit is contained in:
James Magahern
2020-08-14 15:55:08 -07:00
parent 9b36a3ace5
commit 69029a3195
12 changed files with 534 additions and 187 deletions

View File

@@ -7,7 +7,7 @@
import UIKit
class ScriptControllerIconView: UIButton
class ScriptControllerIconView: ReliefButton
{
public var shieldsDown: Bool = false {
didSet { setNeedsLayout() }
@@ -23,8 +23,9 @@ class ScriptControllerIconView: UIButton
private let shieldsUpImage = UIImage(systemName: "shield")
private let shieldsPartiallyUpImage = UIImage(systemName: "shield.lefthalf.fill")
convenience init() {
self.init(frame: .zero)
override init() {
super.init()
addSubview(labelView)
@@ -39,6 +40,10 @@ class ScriptControllerIconView: UIButton
setBlockedScriptsNumber(0)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
public func setBlockedScriptsNumber(_ num: Int) {
if num > 0 {
labelView.isHidden = false