feat: fix start screen window dimensions
This commit is contained in:
@@ -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