Appearance tweaks

This commit is contained in:
James Magahern
2021-07-20 19:17:04 -07:00
parent 777b079f5e
commit 864260bad3
6 changed files with 65 additions and 34 deletions

View File

@@ -118,9 +118,7 @@ class TitlebarView: UIView
let edgePadding: CGFloat = 8.0
// Thought it would be cool to have a different style for regular, but eh.
let securityLabelOnTrailingSide = false // (traitCollection.horizontalSizeClass == .regular)
securityIndicatorView.labelVisible = securityLabelOnTrailingSide
securityIndicatorView.labelVisible = false
var securityIndicatorSize = showsSecurityIndicator ? securityIndicatorView.sizeThatFits(bounds.size) : .zero
securityIndicatorSize.height = 10.0
@@ -133,23 +131,14 @@ class TitlebarView: UIView
if showsSecurityIndicator {
securityIndicatorView.isHidden = false
securityIndicatorView.frame = CGRect(
origin: CGPoint(x: edgePadding + layoutMargins.left, y: 0.0),
size: CGSize(width: securityIndicatorSize.height, height: securityIndicatorSize.height)
)
if !securityLabelOnTrailingSide {
securityIndicatorView.frame = CGRect(
origin: CGPoint(x: edgePadding + layoutMargins.left, y: 0.0),
size: CGSize(width: securityIndicatorSize.height, height: securityIndicatorSize.height)
)
// Scooch the title over a bit
titleLabelView.frame.origin.x = securityIndicatorView.frame.maxX + 4.0
} else {
securityIndicatorView.frame = CGRect(
x: bounds.width - layoutMargins.right - securityIndicatorSize.width, y: 0.0,
width: securityIndicatorSize.width,
height: securityIndicatorSize.height
)
}
// Scooch the title over a bit
titleLabelView.frame.origin.x = securityIndicatorView.frame.maxX + 4.0
securityIndicatorView.frame = securityIndicatorView.frame.centeredY(inRect: titleLabelView.frame)
} else {
securityIndicatorView.isHidden = true