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
2 changes: 1 addition & 1 deletion ios/HEXShared/FullKeyboard/HexKeyViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ final class HexKeyControl: UIControl {
UIBezierPath(roundedRect: cap, cornerRadius: cap.height / 2).fill()
}
// In the strip the mark sits on the suggestions' line, as tall as fits around it there
// (16 pt on a phone held upright, where the line is 8 pt below iOS's band), else 19 pt.
// (19 pt, or less where the line leaves less room).
let markMidY = inStrip ? (markCenterY ?? cap.midY) : cap.midY
let room = inStrip ? 2 * min(markMidY - cap.minY, cap.maxY - markMidY) : cap.height
let markSize: CGFloat = inStrip ? min(19, room) : min(19, cap.height * 0.56)
Expand Down
14 changes: 6 additions & 8 deletions ios/HEXShared/FullKeyboard/KeyboardLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,12 @@ nonisolated struct KeyboardMetrics: Equatable, Sendable {
/// Elsewhere it's the strip less half a point above and below, at most 36 pt.
var stripPillHeight: CGFloat { stripHeight == Self.stripBarHeight ? stripHeight : min(stripHeight - 1, 36) }

/// Apple's bar centres its words and dividers 27 pt above row 1's keycaps (iOS 27.2,
/// iPhone 17 Pro: 25.3 pt below the panel's edge, keycaps at 52 pt). In the phone's portrait
/// strip that's 8 pt down, high in the 27 pt the band leaves; Hex centred them in the strip,
/// 5.7 pt below Apple's. Elsewhere the strip is Apple's bar and they centre in it.
static let barTextAboveKeys: CGFloat = 27
var stripTextCenter: CGFloat {
stripHeight == Self.stripBarHeight ? stripHeight + stripBottom - Self.barTextAboveKeys : stripHeight / 2
}
/// Where the strip's words, dividers and Hex mark centre: on its middle, so a word sits in
/// the middle of its pill as Apple's does. Apple's words are 27 pt above row 1's keycaps
/// (25.3 pt below the panel's edge on the iPhone 17 Pro, iOS 27.2), but its pill reaches
/// 11 pt up into the band iOS draws over a third-party keyboard; putting Hex's words on
/// Apple's line left them high in a pill that can't (#2201), so they sit 5.5 pt lower.
var stripTextCenter: CGFloat { stripHeight / 2 }

/// Apple's keycap corners (iOS 27.2: the same on every iPhone, measured from screenshots
/// against keys Hex drew at known radii).
Expand Down
4 changes: 2 additions & 2 deletions ios/HEXShared/FullKeyboard/KeyboardStripView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import UIKit
/// the iOS 27.2 simulator): SF 17 pt regular in muted ink, slots a third of the keyboard wide,
/// 1 × 24 pt dividers ending on the thirds, and a pending autocorrection as a full-slot
/// capsule with the divider beside it hidden. iOS's band above the keyboard takes the top of
/// Apple's bar, so the words and dividers sit on Apple's line high in the 27 pt below it
/// (`KeyboardMetrics.stripTextCenter`) and the pills fill it. The centred
/// Apple's bar, so the pills fill the 27 pt below it and the words and dividers centre in it
/// (`KeyboardMetrics.stripTextCenter`). The centred
/// `Undo dictation` chip or a status message replaces the slots when needed.
@MainActor
final class KeyboardStripView: UIView {
Expand Down