Files
piotr b169a64ad5
Build Ground Station / build (push) Successful in 44s
feat: show no-WFB kiosk fallback only while video absent (#2)
2026-10-01 14:40:24 +02:00

26 lines
874 B
Go

package display
// FallbackTemplate is the no-video kiosk layout: a cleared black canvas with
// the fallback lines. While decoded video is present the fallback
// disappears: the canvas stays plain black so the video window keeps
// rendering priority without stale text around or behind it, and the exact
// fallback lines return when video ends.
type FallbackTemplate struct {
fallback StatusTemplate
video *VideoPresence
}
// NewFallbackTemplate builds a template that draws the given fallback lines
// only while the shared presence reports no video.
func NewFallbackTemplate(video *VideoPresence, lines ...string) FallbackTemplate {
return FallbackTemplate{fallback: NewStatusTemplate(lines...), video: video}
}
func (t FallbackTemplate) Draw(canvas Canvas) {
canvas.Clear()
if !t.video.Active() {
drawLines(canvas, t.fallback.lines)
}
canvas.Flush()
}