Skip to content

Commit 04a7656

Browse files
Fix the Settings chrome and make the picker tiles readable in light mode
Three fixes to the Settings and splash surfaces: - Settings never set titlebarAppearsTransparent, so its header gradient stopped below an opaque titlebar rather than running up behind it the way About, Help and Splash all do. - Its root frame pinned width to exactly 580, the same width as the window content area, leaving the scroller no room to sit in — it overflowed and was clipped by the right edge. Let the content flex and keep the window's own min/max as the thing that fixes the width, mirroring Help. - The Basic/Pro picker tiles drew their line-art in hardcoded white, but AppearanceButtonStyle fades the tile to near-white in light mode, leaving the art invisible. Draw it in .primary so it inverts with the appearance. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 64ecd39 commit 04a7656

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

Pika/Services/WindowCoordinator.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,12 @@ class WindowCoordinator: NSObject {
430430

431431
func openPreferencesWindow() {
432432
if preferencesWindow == nil, let eyedroppers {
433+
// Width is pinned by the window's own min/max below, not by the SwiftUI frame:
434+
// pinning both would demand the full 580 for content *and* leave the scroller
435+
// with nowhere to go, pushing it past the right edge where the window clips it.
436+
// Letting the content flex mirrors the Help window, whose scroller sits inboard.
433437
let rootView = PreferencesView()
434-
.frame(minWidth: 580, maxWidth: 580, minHeight: 400, maxHeight: .infinity)
438+
.frame(maxWidth: .infinity, minHeight: 400, maxHeight: .infinity)
435439
.ignoresSafeArea()
436440
.environmentObject(eyedroppers)
437441
let view = NSHostingView(rootView: rootView)
@@ -440,6 +444,9 @@ class WindowCoordinator: NSObject {
440444
size: NSRect(x: 0, y: 0, width: 580, height: 600),
441445
styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView]
442446
)
447+
// Matches About/Help/Splash — lets the header gradient run up behind the titlebar
448+
// instead of leaving an opaque bar above it.
449+
preferencesWindow?.titlebarAppearsTransparent = true
443450
preferencesWindow?.minSize = NSSize(width: 580, height: 400)
444451
preferencesWindow?.maxSize = NSSize(width: 580, height: CGFloat.greatestFiniteMagnitude)
445452
preferencesWindow?.contentMinSize = NSSize(width: 580, height: 400)

Pika/Views/SplashView.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,15 @@ private struct PickerComparisonTile: View {
532532
}
533533
}
534534

535-
// Monochrome white-on-dark, matching the app-mode preview art: translucent white
536-
// fills, white line-art, no colour, no container borders.
535+
// Monochrome line-art, matching the app-mode preview art: translucent fills, no colour,
536+
// no container borders. Drawn in `.primary` rather than white so it inverts with the
537+
// appearance — `AppearanceButtonStyle` fades the tile to near-white in light mode, where
538+
// white-on-white left the art invisible.
537539

538540
// Basic picker: a plain, dull loupe — a single flat disc with a faint crosshair.
539541
private var basicMock: some View {
540542
ZStack {
541-
Circle().fill(Color.white.opacity(0.08))
543+
Circle().fill(Color.primary.opacity(0.08))
542544
crosshair(opacity: 0.35)
543545
}
544546
.frame(width: 40.0, height: 40.0)
@@ -550,15 +552,15 @@ private struct PickerComparisonTile: View {
550552
VStack(spacing: 3.0) {
551553
ZStack {
552554
RoundedRectangle(cornerRadius: 3.0, style: .continuous)
553-
.fill(Color.white.opacity(0.12))
555+
.fill(Color.primary.opacity(0.12))
554556
crosshair(opacity: 0.35)
555557
}
556558
.frame(height: 18.0)
557559

558560
HStack(spacing: 4.0) {
559561
skeletonBar(width: 24.0, opacity: 0.3)
560562
Spacer(minLength: 0.0)
561-
Circle().fill(Color.white.opacity(0.35)).frame(width: 5.0, height: 5.0)
563+
Circle().fill(Color.primary.opacity(0.35)).frame(width: 5.0, height: 5.0)
562564
}
563565
}
564566
.padding(.horizontal, 5.0)
@@ -567,18 +569,18 @@ private struct PickerComparisonTile: View {
567569
.frame(width: 52.0)
568570
.background(
569571
RoundedRectangle(cornerRadius: 6.0, style: .continuous)
570-
.fill(Color.white.opacity(0.06))
572+
.fill(Color.primary.opacity(0.06))
571573
)
572574
}
573575

574576
private func crosshair(opacity: Double) -> some View {
575577
Rectangle()
576-
.strokeBorder(Color.white.opacity(opacity), lineWidth: 2.0)
578+
.strokeBorder(Color.primary.opacity(opacity), lineWidth: 2.0)
577579
.frame(width: 9.0, height: 9.0)
578580
}
579581

580582
private func skeletonBar(width: CGFloat, opacity: Double) -> some View {
581-
Capsule().fill(Color.white.opacity(opacity)).frame(width: width, height: 3.0)
583+
Capsule().fill(Color.primary.opacity(opacity)).frame(width: width, height: 3.0)
582584
}
583585
}
584586

0 commit comments

Comments
 (0)