feat: show no-WFB kiosk fallback only while video absent (#2)
Build Ground Station / build (push) Successful in 44s
Build Ground Station / build (push) Successful in 44s
This commit was merged in pull request #9.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user