add missing number of lines

This commit is contained in:
Pfeil, Scott Robert 2021-06-23 10:02:40 -04:00
parent f09892b4c6
commit 8b3b4964b8
5 changed files with 10 additions and 2 deletions

View File

@ -24,7 +24,6 @@ import Foundation
super.setupView()
layer.borderColor = UIColor.mvmCoolGray6.cgColor
layer.borderWidth = 1
label.numberOfLines = 1
addSubview(label)
NSLayoutConstraint.constraintPinSubview(label, pinTop: true, topConstant: 13, pinBottom: true, bottomConstant: 13, pinLeft: true, leftConstant: 15, pinRight: true, rightConstant: 15)
}

View File

@ -21,6 +21,12 @@ import Foundation
case backgroundColor
}
public func setDefaults() {
if label.numberOfLines == nil {
label.numberOfLines = 1
}
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
label = try typeContainer.decode(LabelModel.self, forKey: .label)

View File

@ -64,6 +64,7 @@ open class DoughnutChart: View {
open override func reset() {
super.reset()
titleLabel.reset()
titleLabel.numberOfLines = 1
subTitleLabel.reset()
clearLayers()
}

View File

@ -26,6 +26,9 @@ open class CollapsableNotificationModel: NotificationModel {
open override func setDefaults() {
super.setDefaults()
if topLabel.numberOfLines == nil {
topLabel.numberOfLines = 1
}
if topLabel.textColor == nil {
topLabel.textColor = Color(uiColor: .white)
}

View File

@ -11,7 +11,6 @@ import Foundation
@objcMembers open class CollapsableNotificationTopView: View {
public let label: Label = {
let label = Label(fontStyle: .BoldBodySmall)
label.numberOfLines = 1
label.textAlignment = .center
label.setContentHuggingPriority(.defaultHigh, for: .vertical)
return label