refactor: unify custom shortcut indicators across the app
This commit is contained in:
@@ -242,7 +242,7 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
|
||||
private struct ActionEntry {
|
||||
let view = LauncherRowView()
|
||||
let button: NSButton
|
||||
let returnKey = NSTextField(labelWithString: "↵")
|
||||
let returnKey = ShortcutIndicator("↵")
|
||||
|
||||
init(title: String, symbol: String, color: NSColor) {
|
||||
button = NSButton(title: title, target: nil, action: nil)
|
||||
@@ -259,14 +259,6 @@ private struct ActionEntry {
|
||||
icon.contentTintColor = color
|
||||
icon.imageScaling = .scaleProportionallyDown
|
||||
icon.setAccessibilityElement(false)
|
||||
returnKey.font = .systemFont(ofSize: 14)
|
||||
returnKey.textColor = SunsetPalette.secondaryText
|
||||
returnKey.alignment = .center
|
||||
returnKey.wantsLayer = true
|
||||
returnKey.layer?.cornerRadius = 5
|
||||
returnKey.layer?.borderWidth = 1
|
||||
returnKey.layer?.borderColor = SunsetPalette.secondaryText.withAlphaComponent(0.35).cgColor
|
||||
returnKey.setAccessibilityElement(false)
|
||||
for child in [icon, button, returnKey] {
|
||||
child.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(child)
|
||||
@@ -281,9 +273,7 @@ private struct ActionEntry {
|
||||
button.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
button.trailingAnchor.constraint(equalTo: returnKey.leadingAnchor, constant: -12),
|
||||
returnKey.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -12),
|
||||
returnKey.centerYAnchor.constraint(equalTo: view.centerYAnchor),
|
||||
returnKey.widthAnchor.constraint(equalToConstant: 18),
|
||||
returnKey.heightAnchor.constraint(equalToConstant: 18)
|
||||
returnKey.centerYAnchor.constraint(equalTo: view.centerYAnchor)
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user