updates for debugging

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-18 13:45:22 -05:00
parent b7ef70820d
commit df91effafb
2 changed files with 13 additions and 1 deletions

View File

@ -333,7 +333,7 @@ extension LabelViewController: ComponentSampleable {
}
extension BaseViewController {
func descriptionFor(style: TextStyle, useScaledLineHeight: Bool = false, scaledMode: Bool) -> String {
func descriptionFor(style: TextStyle, useScaledLineHeight: Bool = false, scaledMode: Bool = false) -> String {
let scaledFont = style.font.scaledFont
var customizedDesc: String = "Name: \(style.rawValue) \nFont Face-Weight: \(style.font.fontName)"
customizedDesc += "\nVDS LetterSpacing: \(style.letterSpacing)"

View File

@ -113,15 +113,19 @@ class TitleLockupViewController: BaseViewController<TitleLockup> {
titleTextField.text = titleModel.text
subTitleTextField.text = subTitleModel.text
setTitleModel()
updateOtherTextStyles()
}
func setTitleModel() {
var titleTextStyle: TextStyle?
if let text = titleTextField.text, !text.isEmpty {
component.titleModel = TitleLockup.TitleModel(text: text, isBold: titleIsBold.isOn, standardStyle: titleStandardStylePickerSelectorView.selectedItem)
titleTextStyle = titleIsBold.isOn ? titleStandardStylePickerSelectorView.selectedItem.value.bold : titleStandardStylePickerSelectorView.selectedItem.value.regular
} else {
component.titleModel = nil
}
debug(type: "Title", textStyle: titleTextStyle)
}
func updateOtherTextStyles() {
@ -136,17 +140,25 @@ class TitleLockupViewController: BaseViewController<TitleLockup> {
if let text = subTitleTextField.text, !text.isEmpty {
component.subTitleModel = TitleLockup.SubTitleModel(text: text, standardStyle: style, textColor: subtitleColorPickerSelectorView.selectedItem)
debug(type: "SubTitle", textStyle: style.value.regular)
} else {
component.subTitleModel = nil
}
if let text = eyebrowTextField.text, !text.isEmpty {
component.eyebrowModel = TitleLockup.EyebrowModel(text: text, isBold: eyebrowIsBold.isOn, standardStyle: style)
debug(type: "EyeBrow", textStyle: eyebrowIsBold.isOn ? style.value.bold : style.value.regular)
} else {
component.eyebrowModel = nil
}
}
func debug(type: String, textStyle: TextStyle?) {
guard let textStyle else { return }
DebugLog("\n\(type)\n\(descriptionFor(style: textStyle))\n\n")
}
//Picker
func setupPicker(){
surfacePickerSelectorView.onPickerDidSelect = { [weak self] item in