feat: fix start screen window dimensions
This commit is contained in:
@@ -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.
|
||||
|
||||
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 |
|
||||
| --- | --- |
|
||||
|
||||
@@ -513,6 +513,7 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
return
|
||||
}
|
||||
if fileName == nil { configureStartWindow(showing: false) }
|
||||
transition.acceptOpen(revision: revision, source: source, change: change, savedPosition: savedPosition)
|
||||
queuePlaybackRevision = queue.currentID == nil ? nil : player_get_state(handle).revision
|
||||
queueCompletionHandled = false
|
||||
@@ -710,6 +711,7 @@ final class PlayerModel: ObservableObject {
|
||||
isSeeking = false
|
||||
window?.representedURL = nil
|
||||
window?.title = "Terebi"
|
||||
configureStartWindow(showing: true)
|
||||
revealControls()
|
||||
systemPlayback?.update()
|
||||
}
|
||||
@@ -835,9 +837,26 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
compactWindow.attach(window)
|
||||
updateWindowState()
|
||||
if fileName == nil { configureStartWindow(showing: true) }
|
||||
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() {
|
||||
guard let window else { return }
|
||||
isFullScreen = window.styleMask.contains(.fullScreen)
|
||||
|
||||
Reference in New Issue
Block a user