reverting border width
This commit is contained in:
parent
b3ab4fe7f1
commit
39f7c4c6f4
@ -61,9 +61,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
|||||||
public var disabledTextColor_inverted: Color?
|
public var disabledTextColor_inverted: Color?
|
||||||
public var disabledBorderColor_inverted: Color?
|
public var disabledBorderColor_inverted: Color?
|
||||||
|
|
||||||
public var borderWidth: CGFloat?
|
|
||||||
public var borderWidth_inverted: CGFloat?
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Default Button Facades
|
// MARK: - Default Button Facades
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -105,11 +102,7 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Methods
|
// MARK: - Methods
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
public func getBorderWidth() -> CGFloat? {
|
|
||||||
return isInverted ? borderWidth_inverted : borderWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
public func enabled_fillColor() -> UIColor? {
|
public func enabled_fillColor() -> UIColor? {
|
||||||
return (isInverted ? enabledFillColor_inverted : enabledFillColor)?.uiColor
|
return (isInverted ? enabledFillColor_inverted : enabledFillColor)?.uiColor
|
||||||
}
|
}
|
||||||
@ -145,7 +138,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
|||||||
enabledTextColor_inverted = Color(uiColor: .mvmBlack)
|
enabledTextColor_inverted = Color(uiColor: .mvmBlack)
|
||||||
disabledFillColor_inverted = Color(uiColor: .mvmCoolGray6)
|
disabledFillColor_inverted = Color(uiColor: .mvmCoolGray6)
|
||||||
disabledTextColor_inverted = Color(uiColor: .mvmBlack)
|
disabledTextColor_inverted = Color(uiColor: .mvmBlack)
|
||||||
borderWidth = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Defines the default appearance for the Secondary style.
|
/// Defines the default appearance for the Secondary style.
|
||||||
@ -159,7 +151,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
|
|||||||
enabledBorderColor_inverted = Color(uiColor: .mvmWhite)
|
enabledBorderColor_inverted = Color(uiColor: .mvmWhite)
|
||||||
disabledTextColor_inverted = Color(uiColor: .mvmCoolGray6)
|
disabledTextColor_inverted = Color(uiColor: .mvmCoolGray6)
|
||||||
disabledBorderColor_inverted = Color(uiColor: .mvmCoolGray6)
|
disabledBorderColor_inverted = Color(uiColor: .mvmCoolGray6)
|
||||||
borderWidth = 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -58,7 +58,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
buttonModel?.style = .primary
|
buttonModel?.style = .primary
|
||||||
enabledTitleColor = buttonModel?.enabledColors.text ?? .mvmWhite
|
enabledTitleColor = buttonModel?.enabledColors.text ?? .mvmWhite
|
||||||
disabledTitleColor = buttonModel?.disabledColors.text ?? .mvmWhite
|
disabledTitleColor = buttonModel?.disabledColors.text ?? .mvmWhite
|
||||||
layer.borderWidth = buttonModel?.getBorderWidth() ?? 0
|
layer.borderWidth = 0
|
||||||
backgroundColor = isEnabled ? buttonModel?.enabledColors.fill ?? .mvmBlack : buttonModel?.disabledColors.fill ?? .mvmCoolGray6
|
backgroundColor = isEnabled ? buttonModel?.enabledColors.fill ?? .mvmBlack : buttonModel?.disabledColors.fill ?? .mvmCoolGray6
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
enabledTitleColor = buttonModel?.enabledColors.text ?? .mvmBlack
|
enabledTitleColor = buttonModel?.enabledColors.text ?? .mvmBlack
|
||||||
disabledTitleColor = buttonModel?.disabledColors.text ?? .mvmCoolGray6
|
disabledTitleColor = buttonModel?.disabledColors.text ?? .mvmCoolGray6
|
||||||
backgroundColor = .clear
|
backgroundColor = .clear
|
||||||
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
|
layer.borderWidth = 1
|
||||||
borderColor = isEnabled ? buttonModel?.enabledColors.border ?? .mvmBlack : buttonModel?.disabledColors.border ?? .mvmCoolGray6
|
borderColor = isEnabled ? buttonModel?.enabledColors.border ?? .mvmBlack : buttonModel?.disabledColors.border ?? .mvmCoolGray6
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let borderColor = buttonModel?.enabledColors.border {
|
if let borderColor = buttonModel?.enabledColors.border {
|
||||||
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
|
layer.borderWidth = 1
|
||||||
self.borderColor = borderColor
|
self.borderColor = borderColor
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -107,7 +107,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let borderColor = buttonModel?.disabledColors.border {
|
if let borderColor = buttonModel?.disabledColors.border {
|
||||||
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
|
layer.borderWidth = 1
|
||||||
self.borderColor = borderColor
|
self.borderColor = borderColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user