From 2f0a727d03c4caba948f15ff0d76667545d8f1f7 Mon Sep 17 00:00:00 2001 From: panxi Date: Fri, 26 Apr 2019 13:41:54 -0400 Subject: [PATCH] copy from Kevin's commit: https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui/commit/aac5093c37f2763c5d809701112d5d84eefe3d1c --- MVMCoreUI/Atoms/Buttons/CaretButton.swift | 4 ++-- MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/MVMCoreUI/Atoms/Buttons/CaretButton.swift b/MVMCoreUI/Atoms/Buttons/CaretButton.swift index dfef20ca..838f5d18 100644 --- a/MVMCoreUI/Atoms/Buttons/CaretButton.swift +++ b/MVMCoreUI/Atoms/Buttons/CaretButton.swift @@ -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 //------------------------------------------------------ diff --git a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift index 0fd48295..d47594c1 100644 --- a/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift +++ b/MVMCoreUI/Atoms/Views/LabelWithInternalButton.swift @@ -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])