added height
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
ce6c492f60
commit
e3420da41b
@ -37,6 +37,7 @@ class TileContainerViewController: BaseViewController {
|
|||||||
var showBackgroundImageSwitch = Toggle()
|
var showBackgroundImageSwitch = Toggle()
|
||||||
var showBorderSwitch = Toggle()
|
var showBorderSwitch = Toggle()
|
||||||
var showDropShadowSwitch = Toggle()
|
var showDropShadowSwitch = Toggle()
|
||||||
|
var heightTextField = TextField()
|
||||||
var widthTextField = TextField()
|
var widthTextField = TextField()
|
||||||
|
|
||||||
var tileContainer = TileContainer()
|
var tileContainer = TileContainer()
|
||||||
@ -51,11 +52,16 @@ class TileContainerViewController: BaseViewController {
|
|||||||
setupModel()
|
setupModel()
|
||||||
}
|
}
|
||||||
|
|
||||||
override func allTextFields() -> [UITextField]? { [widthTextField] }
|
override func allTextFields() -> [UITextField]? { [widthTextField, heightTextField] }
|
||||||
|
|
||||||
func setupForm(){
|
func setupForm(){
|
||||||
|
formStackView.addArrangedSubview(Label().with{
|
||||||
|
$0.typograpicalStyle = .BoldBodyLarge
|
||||||
|
$0.text = "This object does NOT reflect normal \"surface\" changes, all properties are maually set"
|
||||||
|
})
|
||||||
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
addFormRow(label: "Surface", view: surfacePickerSelectorView)
|
||||||
addFormRow(label: "Width", view: widthTextField)
|
addFormRow(label: "Width", view: widthTextField)
|
||||||
|
addFormRow(label: "Height", view: heightTextField)
|
||||||
addFormRow(label: "Show Border", view: showBorderSwitch)
|
addFormRow(label: "Show Border", view: showBorderSwitch)
|
||||||
//addFormRow(label: "Show Drop Shadow", view: showDropShadowSwitch)
|
//addFormRow(label: "Show Drop Shadow", view: showDropShadowSwitch)
|
||||||
addFormRow(label: "Background Color", view: backgroundColorPickerSelectorView)
|
addFormRow(label: "Background Color", view: backgroundColorPickerSelectorView)
|
||||||
@ -86,6 +92,16 @@ class TileContainerViewController: BaseViewController {
|
|||||||
self?.tileContainer.showDropShadows = sender.isOn
|
self?.tileContainer.showDropShadows = sender.isOn
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
heightTextField
|
||||||
|
.textPublisher
|
||||||
|
.sink { [weak self] text in
|
||||||
|
if let n = NumberFormatter().number(from: text) {
|
||||||
|
self?.tileContainer.height = CGFloat(truncating: n)
|
||||||
|
} else {
|
||||||
|
self?.tileContainer.height = nil
|
||||||
|
}
|
||||||
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
widthTextField
|
widthTextField
|
||||||
.textPublisher
|
.textPublisher
|
||||||
.sink { [weak self] text in
|
.sink { [weak self] text in
|
||||||
@ -102,6 +118,7 @@ class TileContainerViewController: BaseViewController {
|
|||||||
paddingPickerSelectorView.text = tileContainer.containerPadding.rawValue
|
paddingPickerSelectorView.text = tileContainer.containerPadding.rawValue
|
||||||
scalingTypePickerSelectorView.text = tileContainer.aspectRatio.rawValue
|
scalingTypePickerSelectorView.text = tileContainer.aspectRatio.rawValue
|
||||||
widthTextField.text = "\(tileContainer.width)"
|
widthTextField.text = "\(tileContainer.width)"
|
||||||
|
heightTextField.text = tileContainer.height != nil ? "\(tileContainer.height!)" : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupPicker(){
|
func setupPicker(){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user