Skip to content

Commit 5f857c8

Browse files
Lee Seongjooclaude
andcommitted
HUD: subtitle on/off toggle; center the transport, keep it fixed-size
- Add a captions toggle to the HUD header (per-mode, persisted); A-/A+ show only when the subtitle is on - Move the progress bar to its own full-width row and center the transport cluster so it stays fixed-size and doesn't spread as the panel widens Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fdf931d commit 5f857c8

2 files changed

Lines changed: 29 additions & 13 deletions

File tree

‎Sources/App/AppState.swift‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,12 @@ final class AppState: ObservableObject {
10591059
hudPositions[screenID] = offset
10601060
}
10611061

1062+
/// Flip the subtitle for the current playback mode (TTS vs 해설) and persist.
1063+
func toggleSubtitle() {
1064+
if playbackMode == .tts { subtitleTTS.toggle() } else { subtitleExplain.toggle() }
1065+
saveSettings()
1066+
}
1067+
10621068
func adjustSubtitleFont(by delta: Double) {
10631069
let v = (subtitleFontSize + delta).rounded()
10641070
subtitleFontSize = min(max(v, Self.subtitleFontRange.lowerBound), Self.subtitleFontRange.upperBound)

‎Sources/UI/PlayerOverlay.swift‎

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,23 @@ struct PlayerOverlay: View {
3333
if app.phase == .synthesizing {
3434
ProgressView().controlSize(.small)
3535
Text("합성 중…").font(.caption).foregroundStyle(.secondary)
36-
} else if app.showSubtitle {
37-
HStack(spacing: 2) {
38-
Button { app.adjustSubtitleFont(by: -2) } label: { Image(systemName: "minus") }
39-
.disabled(app.subtitleFontSize <= AppState.subtitleFontRange.lowerBound)
40-
.help("자막 작게")
41-
Image(systemName: "textformat.size").foregroundStyle(.secondary)
42-
Button { app.adjustSubtitleFont(by: 2) } label: { Image(systemName: "plus") }
43-
.disabled(app.subtitleFontSize >= AppState.subtitleFontRange.upperBound)
44-
.help("자막 크게")
36+
} else {
37+
HStack(spacing: 10) {
38+
Button { app.toggleSubtitle() } label: {
39+
Image(systemName: app.showSubtitle ? "captions.bubble.fill" : "captions.bubble")
40+
}
41+
.help(app.showSubtitle ? "자막 끄기" : "자막 켜기")
42+
if app.showSubtitle {
43+
HStack(spacing: 2) {
44+
Button { app.adjustSubtitleFont(by: -2) } label: { Image(systemName: "minus") }
45+
.disabled(app.subtitleFontSize <= AppState.subtitleFontRange.lowerBound)
46+
.help("자막 작게")
47+
Image(systemName: "textformat.size").foregroundStyle(.secondary)
48+
Button { app.adjustSubtitleFont(by: 2) } label: { Image(systemName: "plus") }
49+
.disabled(app.subtitleFontSize >= AppState.subtitleFontRange.upperBound)
50+
.help("자막 크게")
51+
}
52+
}
4553
}
4654
.buttonStyle(.plain)
4755
.font(.caption.weight(.semibold))
@@ -78,7 +86,11 @@ struct PlayerOverlay: View {
7886
}
7987
}
8088

81-
HStack(spacing: 16) {
89+
// Progress spans the width; transport stays a fixed-size, centered
90+
// cluster so it doesn't grow or spread out as the subtitle/panel widen.
91+
ProgressView(value: app.progress).progressViewStyle(.linear)
92+
93+
HStack(spacing: 22) {
8294
Button { app.skipPrev() } label: { Image(systemName: "backward.fill") }
8395
.disabled(!app.canSkipPrev)
8496
Button { app.togglePause() } label: {
@@ -89,12 +101,10 @@ struct PlayerOverlay: View {
89101
.help(app.phase == .paused ? "재개" : "일시정지")
90102
Button { app.skipNext() } label: { Image(systemName: "forward.fill") }
91103
.disabled(!app.canSkipNext)
92-
93-
ProgressView(value: app.progress).progressViewStyle(.linear)
94-
95104
Button { app.stop() } label: { Image(systemName: "stop.fill") }
96105
.foregroundStyle(.secondary).help("중지")
97106
}
107+
.frame(maxWidth: .infinity) // center the cluster in the (possibly wide) panel
98108
.buttonStyle(.plain)
99109
.font(.system(size: 14, weight: .semibold))
100110
}

0 commit comments

Comments
 (0)