Refactored the menu system

This commit is contained in:
maze authored and maze committed 2026-10-29 17:29:54 +01:00
1 parent 4ae7655cd8
commit 86aad51e37
12 files changed
+474 -344

No files matched your search

+2 -20
View File
@@ -124,29 +124,11 @@ func (w *Text) Refresh(ctx app.Context) bool {
}
// Fill background.
if w.styles.Text.Background != nil {
log.Trace("fill canvas with background")
app.ImageCopy(w.buffer, w.styles.Text.Background)
} else {
log.WithField("color", w.styles.Text.BackgroundColor).
Trace("fill canvas with background color")
app.ImageFill(w.buffer, w.styles.Text.BackgroundColor)
}
app.ImageCopy(w.buffer, w.styles.Text.Background())
// Fill text.
inner := w.styles.Text.Inner(w.buffer)
if w.styles.Text.Foreground != nil {
log.WithField("text", w.text).
WithField("inner", inner).
Debug("text canvas with foreground mask")
w.styles.Text.Font.Draw(inner, w.scroll, w.styles.Text.Foreground, w.text)
} else {
log.WithField("text", w.text).
WithField("inner", inner).
WithField("color", w.styles.Text.ForegroundColor).
Debug("text canvas with foreground color")
w.styles.Text.Font.Draw(inner, w.scroll, image.NewUniform(w.styles.Text.ForegroundColor), w.text)
}
w.styles.Text.Font.Draw(inner, w.scroll, w.styles.Text.Foreground(), w.text)
}
// Scroll text if required.