Review comments
This commit is contained in:
parent
ad8d18eabe
commit
f367b03233
@ -64,11 +64,11 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol, FormValidation
|
||||
}
|
||||
|
||||
private func getInnerPadding() -> CGFloat {
|
||||
return (getHeight() / 2.0)
|
||||
return getHeight() / 2.0
|
||||
}
|
||||
|
||||
private func getHeight() -> CGFloat {
|
||||
PillButton.getHeight(for: (model as? ButtonModel)?.size, size: size)
|
||||
PillButton.getHeight(for: buttonModel?.size, size: size)
|
||||
}
|
||||
|
||||
public static func getHeight(for buttonSize: ButtonSize?, size: CGFloat) -> CGFloat {
|
||||
@ -81,7 +81,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol, FormValidation
|
||||
}
|
||||
|
||||
private func getMinimumWidth() -> CGFloat {
|
||||
switch buttonModel?.size ?? .standard {
|
||||
switch buttonModel?.size {
|
||||
case .tiny:
|
||||
return MFSizeObject(standardSize: 49.0, standardiPadPortraitSize: 90.0, iPadProLandscapeSize: 135.0)?.getValueBased(onSize: size) ?? 49.0
|
||||
default:
|
||||
@ -96,7 +96,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol, FormValidation
|
||||
}
|
||||
|
||||
// MARK: - ModelMoleculeViewProtocol
|
||||
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
// The button will get styled in the enable check in super.
|
||||
super.setWithModel(model, delegateObject, additionalData)
|
||||
|
||||
@ -104,7 +104,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol, FormValidation
|
||||
setTitle(model.title, for: .normal)
|
||||
|
||||
if let required = model.required,
|
||||
required == true {
|
||||
required {
|
||||
FormValidator.setupValidation(molecule: self, delegate: delegateObject?.formValidationProtocol)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user