Skip to content

Commit fdf931d

Browse files
Lee Seongjooclaude
andcommitted
HUD: widen the panel with the subtitle font so lines hold a steady char count
Width was fixed at 360, so larger fonts just wrapped more. Now it scales with subtitleFontSize (capped 360–760), keeping ~constant characters per line; stays compact when no subtitle is showing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b7a21c1 commit fdf931d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎Sources/UI/PlayerOverlay.swift‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ struct PlayerOverlay: View {
88

99
private var tint: Color { app.playbackMode == .tts ? .blue : .purple }
1010

11+
/// Widen the HUD with the subtitle font so a line holds roughly the same
12+
/// number of characters at any size — bigger text → wider panel, fewer
13+
/// wraps. Stays compact (360) when no subtitle is showing; capped so it
14+
/// never runs off a normal screen.
15+
private var hudWidth: CGFloat {
16+
guard app.showSubtitle, !app.currentChunkText.isEmpty else { return 360 }
17+
return min(max(360, app.subtitleFontSize * 24), 760)
18+
}
19+
1120
var body: some View {
1221
VStack(alignment: .leading, spacing: 8) {
1322
HStack(spacing: 6) {
@@ -90,7 +99,7 @@ struct PlayerOverlay: View {
9099
.font(.system(size: 14, weight: .semibold))
91100
}
92101
.padding(.horizontal, 16).padding(.vertical, 12)
93-
.frame(width: 360)
102+
.frame(width: hudWidth)
94103
.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 14))
95104
.overlay(RoundedRectangle(cornerRadius: 14).strokeBorder(.white.opacity(0.08)))
96105
}

0 commit comments

Comments
 (0)