~buzzert/rossler.attix#9: Tabs: Too hard to tap on close button

Fix up the margin on the button
This commit is contained in:
James Magahern
2020-10-29 15:19:59 -07:00
parent 59365037c4
commit 509cf66e18

View File

@@ -26,6 +26,7 @@ class TabView: UIControl
addSubview(closeButton)
closeButton.setImage(UIImage(systemName: "xmark.square.fill"), for: .normal)
closeButton.imageView?.contentMode = .center
closeButton.tintColor = .label
addSubview(leftSeparator)
@@ -43,9 +44,9 @@ class TabView: UIControl
let insetBounds = bounds.inset(by: layoutMargins)
let closeButtonPadding = CGFloat(5.0)
let closeButtonSize = CGSize(width: insetBounds.height, height: insetBounds.height)
let closeButtonSize = CGSize(width: bounds.height, height: bounds.height)
closeButton.frame = CGRect(
x: insetBounds.width - closeButtonSize.width, y: insetBounds.minY,
x: insetBounds.width - closeButtonSize.height, y: 0.0,
width: closeButtonSize.width, height: closeButtonSize.height
)