updated controllers
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
68d2a5173e
commit
b9cdc0dc4b
@ -17,6 +17,12 @@ class LabelViewController: BaseViewController {
|
|||||||
picker: self.picker)
|
picker: self.picker)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
lazy var textPositionPickerSelectorView = {
|
||||||
|
PickerSelectorView(title: TextPosition.left.rawValue,
|
||||||
|
picker: self.picker,
|
||||||
|
items: TextPosition.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
lazy var fontCategoryPickerSelectorView = {
|
lazy var fontCategoryPickerSelectorView = {
|
||||||
FontCategoryPickerSelectorView(title: "",
|
FontCategoryPickerSelectorView(title: "",
|
||||||
picker: self.picker)
|
picker: self.picker)
|
||||||
@ -44,6 +50,7 @@ class LabelViewController: BaseViewController {
|
|||||||
addFormRow(label: "Disabled", view: .makeWrapper(for: disabledSwitch))
|
addFormRow(label: "Disabled", view: .makeWrapper(for: disabledSwitch))
|
||||||
addFormRow(label: "Bold", view: .makeWrapper(for: boldSwitch))
|
addFormRow(label: "Bold", view: .makeWrapper(for: boldSwitch))
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
|
addFormRow(label: "Text Position", view: textPositionPickerSelectorView)
|
||||||
addFormRow(label: "Font Category", view: fontCategoryPickerSelectorView)
|
addFormRow(label: "Font Category", view: fontCategoryPickerSelectorView)
|
||||||
addFormRow(label: "Text Size", view: textSizePickerSelectorView)
|
addFormRow(label: "Text Size", view: textSizePickerSelectorView)
|
||||||
addFormRow(label: "Text", view: textField)
|
addFormRow(label: "Text", view: textField)
|
||||||
@ -65,7 +72,7 @@ class LabelViewController: BaseViewController {
|
|||||||
self?.label.text = text
|
self?.label.text = text
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupModel() {
|
func setupModel() {
|
||||||
label.text = "Label Component"
|
label.text = "Label Component"
|
||||||
label.textStyle = .featureSmall
|
label.textStyle = .featureSmall
|
||||||
@ -116,6 +123,10 @@ class LabelViewController: BaseViewController {
|
|||||||
self?.label.surface = item
|
self?.label.surface = item
|
||||||
self?.contentTopView.backgroundColor = item.color
|
self?.contentTopView.backgroundColor = item.color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textPositionPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.label.textPosition = item
|
||||||
|
}
|
||||||
|
|
||||||
textSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
textSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.textSize = item
|
self?.textSize = item
|
||||||
|
|||||||
@ -27,6 +27,12 @@ class TrailingTooltipLabelViewController: BaseViewController {
|
|||||||
picker: self.picker,
|
picker: self.picker,
|
||||||
items: Tooltip.Size.allCases)
|
items: Tooltip.Size.allCases)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
lazy var textPositionPickerSelectorView = {
|
||||||
|
PickerSelectorView(title: TextPosition.left.rawValue,
|
||||||
|
picker: self.picker,
|
||||||
|
items: TextPosition.allCases)
|
||||||
|
}()
|
||||||
|
|
||||||
var boldSwitch = Toggle()
|
var boldSwitch = Toggle()
|
||||||
var disabledSwitch = Toggle()
|
var disabledSwitch = Toggle()
|
||||||
@ -55,6 +61,7 @@ class TrailingTooltipLabelViewController: BaseViewController {
|
|||||||
addFormRow(label: "Disabled", view: .makeWrapper(for: disabledSwitch))
|
addFormRow(label: "Disabled", view: .makeWrapper(for: disabledSwitch))
|
||||||
addFormRow(label: "Bold", view: .makeWrapper(for: boldSwitch))
|
addFormRow(label: "Bold", view: .makeWrapper(for: boldSwitch))
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
|
addFormRow(label: "Text Position", view: textPositionPickerSelectorView)
|
||||||
addFormRow(label: "Font Category", view: fontCategoryPickerSelectorView)
|
addFormRow(label: "Font Category", view: fontCategoryPickerSelectorView)
|
||||||
addFormRow(label: "Text Size", view: textSizePickerSelectorView)
|
addFormRow(label: "Text Size", view: textSizePickerSelectorView)
|
||||||
addFormRow(label: "Text", view: textField)
|
addFormRow(label: "Text", view: textField)
|
||||||
@ -162,10 +169,14 @@ class TrailingTooltipLabelViewController: BaseViewController {
|
|||||||
self?.contentTopView.backgroundColor = item.color
|
self?.contentTopView.backgroundColor = item.color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textPositionPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
|
self?.tooltipLabel.labelTextPosition = item
|
||||||
|
}
|
||||||
|
|
||||||
textSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
textSizePickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.textSize = item
|
self?.textSize = item
|
||||||
}
|
}
|
||||||
|
|
||||||
fontCategoryPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
fontCategoryPickerSelectorView.onPickerDidSelect = { [weak self] item in
|
||||||
self?.fontCategory = item
|
self?.fontCategory = item
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user