Commit 507affe6 by Daniel Dahan

added border types

parent 30598cc5
......@@ -29,7 +29,8 @@ public class FlatButton : MaterialButton {
backgroundColor = MaterialColor.red.base //MaterialTheme.button.flat.backgroudColor
cornerRadius = MaterialTheme.button.flat.cornerRadius
contentInsets = MaterialTheme.button.flat.contentInsets
border = MaterialTheme.button.flat.border
borderWidth = MaterialTheme.button.flat.borderWidth
borderColor = MaterialTheme.button.flat.bordercolor
}
//
......
......@@ -32,8 +32,8 @@ public enum MaterialBorder : MaterialBorderType {
/**
:name: MaterialBorderToValue
*/
public func MaterialBorderToValue(border: MaterialBorder) -> MaterialBorderType {
switch border {
public func MaterialBorderToValue(width: MaterialBorder) -> MaterialBorderType {
switch width {
case .None:
return 0
case .Thin:
......
......@@ -127,11 +127,20 @@ public class MaterialButton : UIButton {
}
/**
:name: border
:name: borderWidth
*/
public var border: MaterialBorder! {
public var borderWidth: MaterialBorder! {
didSet {
layer.borderWidth = MaterialBorderToValue(border)
layer.borderWidth = MaterialBorderToValue(borderWidth)
}
}
/**
:name: borderColor
*/
public var borderColor: UIColor! {
didSet {
layer.borderColor = borderColor.CGColor
}
}
......
......@@ -45,7 +45,8 @@ public extension MaterialTheme.view {
public static let cornerRadius: MaterialRadius = .Square
// border
public static let border: MaterialBorder = .None
public static let borderWidth: MaterialBorder = .None
public static let bordercolor: UIColor = MaterialColor.black
// color
public static let backgroudColor: UIColor = MaterialColor.white
......@@ -80,7 +81,8 @@ public extension MaterialTheme.navigation {
public static let cornerRadius: MaterialRadius = MaterialTheme.view.cornerRadius
// border
public static let border: MaterialBorder = MaterialTheme.view.border
public static let borderWidth: MaterialBorder = MaterialTheme.view.borderWidth
public static let bordercolor: UIColor = MaterialTheme.view.bordercolor
// color
public static let backgroudColor: UIColor = MaterialColor.blue.accent3
......@@ -111,7 +113,8 @@ public extension MaterialTheme.button {
public static let contentInsets: MaterialInsets = .Inset2
// border
public static let border: MaterialBorder = MaterialTheme.view.border
public static let borderWidth: MaterialBorder = MaterialTheme.view.borderWidth
public static let bordercolor: UIColor = MaterialTheme.view.bordercolor
// color
public static let backgroudColor: UIColor = MaterialColor.clear
......@@ -139,7 +142,8 @@ public extension MaterialTheme.button.flat {
public static let contentInsets: MaterialInsets = MaterialTheme.button.contentInsets
// border
public static let border: MaterialBorder = MaterialTheme.button.border
public static let borderWidth: MaterialBorder = MaterialTheme.button.borderWidth
public static let bordercolor: UIColor = MaterialTheme.button.bordercolor
// color
public static let backgroudColor: UIColor = MaterialTheme.button.backgroudColor
......
......@@ -172,11 +172,20 @@ public class MaterialView: UIView {
}
/**
:name: border
:name: borderWidth
*/
public var border: MaterialBorder! {
public var borderWidth: MaterialBorder! {
didSet {
layer.borderWidth = MaterialBorderToValue(border)
layer.borderWidth = MaterialBorderToValue(borderWidth)
}
}
/**
:name: borderColor
*/
public var borderColor: UIColor! {
didSet {
layer.borderColor = borderColor.CGColor
}
}
......@@ -256,6 +265,8 @@ public class MaterialView: UIView {
zPosition = MaterialTheme.view.zPosition
masksToBounds = MaterialTheme.view.masksToBounds
cornerRadius = MaterialTheme.view.cornerRadius
borderWidth = .None
borderColor = MaterialTheme.view.bordercolor
}
}
......@@ -59,5 +59,7 @@ public class NavigationBarView: MaterialView {
zPosition = MaterialTheme.navigation.zPosition
masksToBounds = MaterialTheme.navigation.masksToBounds
cornerRadius = MaterialTheme.navigation.cornerRadius
borderWidth = .None
borderColor = MaterialTheme.view.bordercolor
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment