Commit 6079c5d3 by Daniel Dahan

development: progressive code style changes as tweaking TabBar

parent 2720a8fb
......@@ -270,12 +270,12 @@ open class TabBar: Bar {
divider.reload()
let centralWidth = width - l - r
let buttonsWidth = buttons.reduce(0) { $0 + $1.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: contentView.height)).width + interimSpace }
let shouldScroll = (.scrollable == tabBarStyle) && (buttonsWidth > centralWidth)
let buttonsWidth = buttons.reduce(0) {
$0 + $1.sizeThatFits(CGSize(width: .greatestFiniteMagnitude, height: contentView.height)).width + interimSpace
}
if shouldScroll {
scrollView.frame = CGRect(x: l, y: 0, width: centralWidth, height: height)
if .scrollable == tabBarStyle && buttonsWidth > p {
scrollView.frame = CGRect(x: l, y: 0, width: p, height: height)
var w: CGFloat = 0
......
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