feat: fix start screen window dimensions

This commit is contained in:
2026-10-18 23:06:37 +02:00
parent a6fa54fc42
commit 4748e3ea2f
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ Builds are ad-hoc signed for personal use, not notarized. Bundled licenses and s
Open one or more local files with **⌘O**, drag them onto the video, or use Finder's **Open With**. A selection replaces the session's queue and plays in natural filename order (for example, episode 2 before episode 10). Open YouTube with **⇧⌘O** or drop a video link. Media starts automatically and resumes its saved position; finished videos restart from the beginning. Live and audio-only media do not save progress. Open one or more local files with **⌘O**, drag them onto the video, or use Finder's **Open With**. A selection replaces the session's queue and plays in natural filename order (for example, episode 2 before episode 10). Open YouTube with **⇧⌘O** or drop a video link. Media starts automatically and resumes its saved position; finished videos restart from the beginning. Live and audio-only media do not save progress.
The start screen uses a two-pane layout: Terebi's identity and version on the left; **Open…**, **Open URL…**, and the six most recently played local files or YouTube videos on the right. Shortcut hints follow your configured bindings. **Open URL…** reveals a focused inline YouTube field. When the most recent item has saved progress, it appears once as a **Resume** row with its saved timestamp. Recent titles and ordering survive relaunches; failed opens are not added. Resolved streams are excluded because reopening them requires a fresh external handoff. The action pane scrolls in small windows, and drag-and-drop remains available. The start screen uses a fixed 640 × 400-point two-pane window: Terebi's identity and version on the left; **Open…**, **Open URL…**, and the six most recently played local files or YouTube videos on the right. Opening media restores normal resizing; closing media returns to the fixed start size. Shortcut hints follow your configured bindings. **Open URL…** reveals a focused inline YouTube field. When the most recent item has saved progress, it appears once as a **Resume** row with its saved timestamp. Recent titles and ordering survive relaunches; failed opens are not added. Resolved streams are excluded because reopening them requires a fresh external handoff. The action pane scrolls, and drag-and-drop remains available.
| Action | Default shortcut | | Action | Default shortcut |
| --- | --- | | --- | --- |
+19
View File
@@ -513,6 +513,7 @@ final class PlayerModel: ObservableObject {
} }
return return
} }
if fileName == nil { configureStartWindow(showing: false) }
transition.acceptOpen(revision: revision, source: source, change: change, savedPosition: savedPosition) transition.acceptOpen(revision: revision, source: source, change: change, savedPosition: savedPosition)
queuePlaybackRevision = queue.currentID == nil ? nil : player_get_state(handle).revision queuePlaybackRevision = queue.currentID == nil ? nil : player_get_state(handle).revision
queueCompletionHandled = false queueCompletionHandled = false
@@ -710,6 +711,7 @@ final class PlayerModel: ObservableObject {
isSeeking = false isSeeking = false
window?.representedURL = nil window?.representedURL = nil
window?.title = "Terebi" window?.title = "Terebi"
configureStartWindow(showing: true)
revealControls() revealControls()
systemPlayback?.update() systemPlayback?.update()
} }
@@ -835,9 +837,26 @@ final class PlayerModel: ObservableObject {
} }
compactWindow.attach(window) compactWindow.attach(window)
updateWindowState() updateWindowState()
if fileName == nil { configureStartWindow(showing: true) }
fitVideoWindow() fitVideoWindow()
} }
private func configureStartWindow(showing: Bool) {
guard let window else { return }
if showing {
let size = NSSize(width: 640, height: 400)
window.resizeIncrements = NSSize(width: 1, height: 1)
window.contentMinSize = size
window.contentMaxSize = size
window.setContentSize(size)
window.styleMask.remove(.resizable)
} else {
window.styleMask.insert(.resizable)
window.contentMaxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)
window.contentMinSize = NSSize(width: 400, height: 240)
}
}
func updateWindowState() { func updateWindowState() {
guard let window else { return } guard let window else { return }
isFullScreen = window.styleMask.contains(.fullScreen) isFullScreen = window.styleMask.contains(.fullScreen)