reverting border width

This commit is contained in:
Kevin G Christiano 2020-05-06 14:41:18 -04:00
parent b3ab4fe7f1
commit 39f7c4c6f4
2 changed files with 5 additions and 14 deletions

View File

@ -61,9 +61,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
public var disabledTextColor_inverted: Color?
public var disabledBorderColor_inverted: Color?
public var borderWidth: CGFloat?
public var borderWidth_inverted: CGFloat?
//--------------------------------------------------
// MARK: - Default Button Facades
//--------------------------------------------------
@ -105,11 +102,7 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
//--------------------------------------------------
// MARK: - Methods
//--------------------------------------------------
public func getBorderWidth() -> CGFloat? {
return isInverted ? borderWidth_inverted : borderWidth
}
public func enabled_fillColor() -> UIColor? {
return (isInverted ? enabledFillColor_inverted : enabledFillColor)?.uiColor
}
@ -145,7 +138,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
enabledTextColor_inverted = Color(uiColor: .mvmBlack)
disabledFillColor_inverted = Color(uiColor: .mvmCoolGray6)
disabledTextColor_inverted = Color(uiColor: .mvmBlack)
borderWidth = 0
}
/// Defines the default appearance for the Secondary style.
@ -159,7 +151,6 @@ public class ButtonModel: ButtonModelProtocol, MoleculeModelProtocol, FormGroupW
enabledBorderColor_inverted = Color(uiColor: .mvmWhite)
disabledTextColor_inverted = Color(uiColor: .mvmCoolGray6)
disabledBorderColor_inverted = Color(uiColor: .mvmCoolGray6)
borderWidth = 1
}
//--------------------------------------------------

View File

@ -58,7 +58,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
buttonModel?.style = .primary
enabledTitleColor = buttonModel?.enabledColors.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
}
@ -69,7 +69,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
enabledTitleColor = buttonModel?.enabledColors.text ?? .mvmBlack
disabledTitleColor = buttonModel?.disabledColors.text ?? .mvmCoolGray6
backgroundColor = .clear
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
layer.borderWidth = 1
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 {
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
layer.borderWidth = 1
self.borderColor = borderColor
}
} else {
@ -107,7 +107,7 @@ open class PillButton: Button, MVMCoreUIViewConstrainingProtocol {
}
if let borderColor = buttonModel?.disabledColors.border {
layer.borderWidth = buttonModel?.getBorderWidth() ?? 1
layer.borderWidth = 1
self.borderColor = borderColor
}
}