copy from Kevin's commit: aac5093c37

This commit is contained in:
panxi 2019-04-26 13:41:54 -04:00
parent d380328913
commit 2f0a727d03
2 changed files with 12 additions and 5 deletions

View File

@ -13,8 +13,8 @@ open class CaretButton: MFCustomButton {
// MARK: - Constants
//------------------------------------------------------
private let CARET_VIEW_HEIGHT: Float = 10.8
private let CARET_VIEW_WIDTH: Float = 6.6
private let CARET_VIEW_HEIGHT: Float = 10.5
private let CARET_VIEW_WIDTH: Float = 6.5
//------------------------------------------------------

View File

@ -74,9 +74,16 @@ public typealias CoreObjectActionLoadPresentDelegate = MVMCoreActionDelegateProt
public var actionText: String?
public var backText: String?
private var text: String? {
willSet(newText) {
attributedText = NSAttributedString(string: newText ?? "")
private var internalText: String = ""
public var text: String? {
get {
return internalText
}
set {
guard let text = newValue else { return }
internalText = text
attributedText = NSAttributedString(string: text)
setAlternateNormalTextAttributes([NSAttributedString.Key.font: normalTextFont as Any])
setAlternateActionTextAttributes([NSAttributedString.Key.font: actionTextFont as Any])
setAlternateNormalTextAttributes([NSAttributedString.Key.foregroundColor: normalTextColor as Any])