Commit 8d51e73c by Daniel Dahan

updated width to 56 from 58 in grid default

parent 84197934
...@@ -156,7 +156,7 @@ public class ControlView : MaterialView { ...@@ -156,7 +156,7 @@ public class ControlView : MaterialView {
if let b: UIButton = c as? UIButton { if let b: UIButton = c as? UIButton {
b.contentEdgeInsets = UIEdgeInsetsZero b.contentEdgeInsets = UIEdgeInsetsZero
} }
c.frame.size.height = height - contentInset.top - contentInset.bottom
c.grid.columns = 0 == g ? 1 : Int(ceil(w / g)) c.grid.columns = 0 == g ? 1 : Int(ceil(w / g))
contentView.grid.columns -= c.grid.columns contentView.grid.columns -= c.grid.columns
grid.views?.append(c) grid.views?.append(c)
...@@ -172,10 +172,9 @@ public class ControlView : MaterialView { ...@@ -172,10 +172,9 @@ public class ControlView : MaterialView {
if let b: UIButton = c as? UIButton { if let b: UIButton = c as? UIButton {
b.contentEdgeInsets = UIEdgeInsetsZero b.contentEdgeInsets = UIEdgeInsetsZero
} }
c.frame.size.height = height - contentInset.top - contentInset.bottom
c.grid.columns = 0 == g ? 1 : Int(ceil(w / g)) c.grid.columns = 0 == g ? 1 : Int(ceil(w / g))
contentView.grid.columns -= c.grid.columns contentView.grid.columns -= c.grid.columns
grid.views?.append(c) grid.views?.append(c)
} }
} }
......
...@@ -71,19 +71,18 @@ public class StatusBarView : ControlView { ...@@ -71,19 +71,18 @@ public class StatusBarView : ControlView {
width = MaterialDevice.width width = MaterialDevice.width
} }
grid.axis.columns = Int(width / 48) grid.axis.columns = Int(width / 56)
// We can call super now that we have a width.
super.layoutSubviews()
// General alignment. // General alignment.
if .iPhone == MaterialDevice.type && MaterialDevice.landscape { if .iPhone == MaterialDevice.type && MaterialDevice.landscape {
grid.contentInset.top = 8 contentInset.top = 0
height = heightForLandscapeOrientation height = heightForLandscapeOrientation
} else { } else {
grid.contentInset.top = heightForStatusBar + 8 contentInset.top = heightForStatusBar
height = heightForPortraitOrientation height = heightForPortraitOrientation
} }
// We can call super now that we have a width.
super.layoutSubviews()
} }
public override func intrinsicContentSize() -> CGSize { public override func intrinsicContentSize() -> CGSize {
......
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