removed ui button default padding around UILabel
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
482ebc18a8
commit
5567c1174a
@ -89,7 +89,11 @@ open class TextLink: ButtonBase {
|
|||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Overrides
|
// MARK: - Overrides
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
open override var intrinsicContentSize: CGSize {
|
||||||
|
return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize
|
||||||
|
}
|
||||||
|
|
||||||
open override func updateView() {
|
open override func updateView() {
|
||||||
//need to set the properties so the super class
|
//need to set the properties so the super class
|
||||||
//can render out the label correctly
|
//can render out the label correctly
|
||||||
|
|||||||
@ -49,7 +49,7 @@ open class TextLinkCaret: ButtonBase {
|
|||||||
get{ _text }
|
get{ _text }
|
||||||
set {
|
set {
|
||||||
var updatedText = newValue ?? ""
|
var updatedText = newValue ?? ""
|
||||||
updatedText = iconPosition == .right ? "\(updatedText) " : " \(updatedText)"
|
updatedText = iconPosition == .right ? "\(updatedText) " : " \(updatedText)"
|
||||||
_text = updatedText
|
_text = updatedText
|
||||||
didChange()
|
didChange()
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ open class TextLinkCaret: ButtonBase {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
open override func setup() {
|
open override func setup() {
|
||||||
super.setup()
|
super.setup()
|
||||||
|
|
||||||
let size = caretView.size!.dimensions()
|
let size = caretView.size!.dimensions()
|
||||||
caretView.frame = .init(x: 0, y: 0, width: size.width, height: size.height)
|
caretView.frame = .init(x: 0, y: 0, width: size.width, height: size.height)
|
||||||
}
|
}
|
||||||
@ -103,7 +103,9 @@ open class TextLinkCaret: ButtonBase {
|
|||||||
// MARK: - Overrides
|
// MARK: - Overrides
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
override open var intrinsicContentSize: CGSize {
|
override open var intrinsicContentSize: CGSize {
|
||||||
let size = super.intrinsicContentSize
|
//get the labels size, if not the button
|
||||||
|
let size = titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize
|
||||||
|
|
||||||
var itemWidth = size.width
|
var itemWidth = size.width
|
||||||
|
|
||||||
if let caretWidth = caretView.size?.dimensions().width {
|
if let caretWidth = caretView.size?.dimensions().width {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user