macOS: command palette visual tweaks

pull/7153/head
Mitchell Hashimoto 2025-04-21 10:32:07 -07:00
parent baad082438
commit e33eed0216
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
3 changed files with 21 additions and 9 deletions

View File

@ -91,10 +91,16 @@ struct CommandPaletteView: View {
option.action() option.action()
} }
} }
.frame(width: 500) .frame(maxWidth: 500)
.background(backgroundColor) .background(
.cornerRadius(12) RoundedRectangle(cornerRadius: 12)
.shadow(radius: 20) .fill(backgroundColor)
.shadow(color: .black.opacity(0.4), radius: 10, x: 0, y: 10)
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(Color.black.opacity(0.1), lineWidth: 1)
)
)
.padding() .padding()
} }
} }
@ -179,7 +185,7 @@ fileprivate struct CommandTable: View {
} }
} }
} }
.frame(height: 200) .frame(maxHeight: 200)
.onChange(of: selectedIndex) { _ in .onChange(of: selectedIndex) { _ in
guard selectedIndex < options.count else { return } guard selectedIndex < options.count else { return }
withAnimation { withAnimation {
@ -207,8 +213,14 @@ fileprivate struct CommandRow: View {
Spacer() Spacer()
if let shortcut = option.shortcut { if let shortcut = option.shortcut {
Text(shortcut) Text(shortcut)
.foregroundStyle(.secondary) .font(.system(.body, design: .monospaced))
.font(.system(size: 12)) .kerning(1.5)
.padding(.horizontal, 6)
.padding(.vertical, 2)
.background(
RoundedRectangle(cornerRadius: 6)
.fill(Color.gray.opacity(0.2))
)
} }
} }
.padding(.horizontal, 6) .padding(.horizontal, 6)

View File

@ -41,7 +41,7 @@ struct TerminalCommandPaletteView: View {
if isPresented { if isPresented {
GeometryReader { geometry in GeometryReader { geometry in
VStack { VStack {
Spacer().frame(height: geometry.size.height * 0.1) Spacer().frame(height: geometry.size.height * 0.05)
ResponderChainInjector(responder: surfaceView) ResponderChainInjector(responder: surfaceView)
.frame(width: 0, height: 0) .frame(width: 0, height: 0)

View File

@ -29,7 +29,7 @@ extension KeyboardShortcut: @retroactive CustomStringConvertible {
case .leftArrow: keyString = "" case .leftArrow: keyString = ""
case .rightArrow: keyString = "" case .rightArrow: keyString = ""
default: default:
keyString = String(key.character) keyString = String(key.character.uppercased())
} }
result.append(keyString) result.append(keyString)