Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions App/CommandPalette/CommandPaletteController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ enum PaletteMetrics {
static let listPadding: CGFloat = 6
/// Transparent room around the glass for its SwiftUI shadow. The window
/// shadow can't be used: it is cut from the panel's rectangle, not the
/// rounded glass.
static let shadowMargin: CGFloat = 32
/// rounded glass. The blur fades out about 2× its radius past the glass,
/// plus the offset; anything smaller clips it to a hard, square edge.
static let shadowRadius: CGFloat = 16
static let shadowY: CGFloat = 8
static let shadowMargin: CGFloat = 3 * shadowRadius + shadowY
static let maxListHeight: CGFloat = 8 * rowHeight + 2 * headerHeight + 2 * listPadding

static func listHeight(for items: [PaletteItem], connecting: Bool = false) -> CGFloat {
Expand Down
2 changes: 1 addition & 1 deletion App/UI/CommandPaletteView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct CommandPaletteView: View {
.frame(width: PaletteMetrics.width)
.containerShape(PaletteMetrics.panelShape)
.glassSurface(in: PaletteMetrics.panelShape)
.shadow(color: .black.opacity(0.25), radius: 16, y: 8)
.shadow(color: .black.opacity(0.25), radius: PaletteMetrics.shadowRadius, y: PaletteMetrics.shadowY)
.padding(PaletteMetrics.shadowMargin)
.onAppear { fieldFocused = true }
.onChange(of: controller.isPresented) { _, presented in
Expand Down