Merge branch 'bugfix/button_inv_fix' into 'develop'
init style for button See merge request BPHV_MIPS/mvm_core_ui!426
This commit is contained in:
commit
1ff0b1bc27
@ -24,13 +24,7 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
||||
public var style: Styler.Button.Style? {
|
||||
didSet {
|
||||
guard let style = style else { return }
|
||||
switch style {
|
||||
case .primary:
|
||||
setPrimaryFacade()
|
||||
|
||||
case .secondary:
|
||||
setSecondaryFacade()
|
||||
}
|
||||
setFacade(by: style)
|
||||
}
|
||||
}
|
||||
public var size: Styler.Button.Size? = .standard
|
||||
@ -160,6 +154,17 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
||||
disabledBorderColor_inverted = Color(uiColor: .mvmCoolGray6)
|
||||
}
|
||||
|
||||
public func setFacade(by style: Styler.Button.Style) {
|
||||
|
||||
switch style {
|
||||
case .primary:
|
||||
setPrimaryFacade()
|
||||
|
||||
case .secondary:
|
||||
setSecondaryFacade()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Keys
|
||||
//--------------------------------------------------
|
||||
@ -195,6 +200,7 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
||||
|
||||
if let style = try typeContainer.decodeIfPresent(Styler.Button.Style.self, forKey: .style) {
|
||||
self.style = style
|
||||
setFacade(by: style)
|
||||
}
|
||||
|
||||
if let size = try typeContainer.decodeIfPresent(Styler.Button.Size.self, forKey: .size) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user