style: widen number fade and brighten larger badges
This commit is contained in:
@@ -3,7 +3,7 @@ import CoreText
|
||||
|
||||
@MainActor
|
||||
final class ShortcutIndicator: NSStackView {
|
||||
init(_ keys: String..., backgroundColor: NSColor? = nil) {
|
||||
init(_ keys: String..., backgroundColor: NSColor? = nil, fontSize: CGFloat = 12, keySize: CGFloat = 18) {
|
||||
super.init(frame: .zero)
|
||||
orientation = .horizontal
|
||||
alignment = .centerY
|
||||
@@ -14,7 +14,7 @@ final class ShortcutIndicator: NSStackView {
|
||||
setAccessibilityElement(false)
|
||||
for key in keys {
|
||||
let badge = ShortcutKeyBadge(labelWithString: key)
|
||||
badge.font = .systemFont(ofSize: 12, weight: .medium)
|
||||
badge.font = .systemFont(ofSize: fontSize, weight: .medium)
|
||||
badge.textColor = SunsetPalette.secondaryText
|
||||
badge.alignment = .center
|
||||
badge.wantsLayer = true
|
||||
@@ -25,8 +25,8 @@ final class ShortcutIndicator: NSStackView {
|
||||
badge.setAccessibilityElement(false)
|
||||
badge.translatesAutoresizingMaskIntoConstraints = false
|
||||
NSLayoutConstraint.activate([
|
||||
badge.widthAnchor.constraint(equalToConstant: 18),
|
||||
badge.heightAnchor.constraint(equalToConstant: 18)
|
||||
badge.widthAnchor.constraint(equalToConstant: keySize),
|
||||
badge.heightAnchor.constraint(equalToConstant: keySize)
|
||||
])
|
||||
addArrangedSubview(badge)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user