Skip to content

Commit 81fe9f9

Browse files
Stop hiding the type labels whenever the preview is shown
The labels were tied to the preview pill on the grounds that the pill sat on top of them, but the pill is anchored to the top of the swatches and the labels to the bottom, so they don't contend for the same space. Measured at every height from the pill's own minimum (200) upward, the smallest gap between the two is still around 30pt — so at any size where the preview appears at all, there was room for both.
1 parent bbc0e23 commit 81fe9f9

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

Pika/Views/ContentView.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import UniformTypeIdentifiers
66
/// Height thresholds (in points of available window content height) below which each
77
/// element is shed, so the window can shrink far smaller than the sum of everything.
88
/// Ordered largest-first to match the shed order: palettes drop first, then contrast,
9-
/// preview, and colour names. Type labels are the last to go, but they hide only via the
10-
/// preview-pill overlap — the window floor (160) sits above any useful height threshold
11-
/// for them. These are the tuning knobs for the adaptive layout.
9+
/// preview, and colour names. Type labels never shed on height — the window floor (160)
10+
/// sits above any useful threshold for them. These are the tuning knobs for the adaptive
11+
/// layout.
1212
enum PikaAdaptiveHeight {
1313
static let floor: CGFloat = 160 // bare minimum content height (matches window frame min ≈ 200pt window)
1414
static let expandCornerBelow: CGFloat = 200 // below this content height (~240pt window) the button tucks top-right
@@ -111,8 +111,6 @@ struct ContentView: View {
111111
let allowContrastWidth = width >= PikaAdaptiveWidth.contrast
112112
let allowContrast = allowContrastHeight && allowContrastWidth
113113
let allowPalettes = height >= PikaAdaptiveHeight.palettes && width >= PikaAdaptiveWidth.palettes
114-
// The preview pill overlaps the type labels, so labels only show when the
115-
// pill is effectively hidden.
116114
let previewVisible = showColorPreview && allowPreview
117115

118116
// An enabled element we're hiding purely for space. When any exist, offer to
@@ -199,9 +197,12 @@ struct ContentView: View {
199197
}
200198
.frame(width: geo.size.width, height: geo.size.height, alignment: .top)
201199
.environment(\.pikaAdaptiveVisibility, PikaAdaptiveVisibility(
202-
// Type labels sit behind the preview pill, so they hide only when it shows
203-
// — the window floor keeps height above any threshold that would drop them.
204-
showsTypeLabels: !previewVisible,
200+
// Not tied to the preview pill: the pill is anchored to the top of the
201+
// swatches and the labels to the bottom, so they don't contend for the same
202+
// space — measured at every height from the pill's own minimum (200) upward,
203+
// the smallest gap between them is still ~30pt. The window floor keeps height
204+
// above any threshold that would drop the labels on their own account.
205+
showsTypeLabels: true,
205206
showsColorNames: height >= PikaAdaptiveHeight.colorNames,
206207
swatchWidth: width / 2
207208
))

0 commit comments

Comments
 (0)