Refactored the menu system
This commit is contained in:
12 files changed
+474
-344
No files matched your search
+2
-20
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user