updated titleLockup logic for janet

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-02 11:05:21 -05:00
parent f10ea3d5d6
commit 635d5abe9f

View File

@ -309,15 +309,27 @@ open class TitleLockup: View {
if let eyebrowModel, !eyebrowModel.text.isEmpty {
eyebrowTextIsEmpty = false
eyebrowLabel.textPosition = allLabelsTextPosition
eyebrowLabel.textStyle = eyebrowModel.isBold ? otherStandardStyle.value.bold : otherStandardStyle.value.regular
eyebrowLabel.text = eyebrowModel.text
eyebrowLabel.attributes = eyebrowModel.textAttributes
eyebrowLabel.numberOfLines = eyebrowModel.numberOfLines
eyebrowLabel.surface = surface
if let titleModel, isUniformSize && titleModel.isBold {
eyebrowLabel.textColorConfiguration = textColorSecondaryConfiguration
//When uniform size is true
if let titleModel, isUniformSize {
if titleModel.isBold {
//When uniform size is true and the title is bold,
//the eyebrow is always regular weight and the secondary color.
eyebrowLabel.textStyle = otherStandardStyle.value.regular
eyebrowLabel.textColorConfiguration = textColorSecondaryConfiguration
} else {
//When uniform size is true and the title is regular weight
//the eyebrow is always bold and uses the primary color.
eyebrowLabel.textStyle = otherStandardStyle.value.bold
eyebrowLabel.textColorConfiguration = textColorPrimaryConfiguration
}
} else {
eyebrowLabel.textColorConfiguration = textColorPrimaryConfiguration
eyebrowLabel.textStyle = eyebrowModel.isBold ? otherStandardStyle.value.bold : otherStandardStyle.value.regular
}
} else {
eyebrowLabel.reset()