aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-03-27 00:44:48 +0900
committernsfisis <nsfisis@gmail.com>2025-03-27 00:44:48 +0900
commitc40e74fed85e3f0c5b084ddf3deba79d31e6926b (patch)
treecd6616fd34f7512976e755aa87858758a375fa57
parent9d4885e464089aecd9fab2029ec4e0968baec57d (diff)
downloadterm-clock-c40e74fed85e3f0c5b084ddf3deba79d31e6926b.tar.gz
term-clock-c40e74fed85e3f0c5b084ddf3deba79d31e6926b.tar.zst
term-clock-c40e74fed85e3f0c5b084ddf3deba79d31e6926b.zip
fix: tcell.Screen.Clear() does not use the current style
It always use StyleDefault as brush.
-rw-r--r--internal/term/draw.go2
-rw-r--r--internal/term/screen.go3
2 files changed, 2 insertions, 3 deletions
diff --git a/internal/term/draw.go b/internal/term/draw.go
index 9ce640a..2ded6b3 100644
--- a/internal/term/draw.go
+++ b/internal/term/draw.go
@@ -12,7 +12,7 @@ var (
)
func init() {
- BgStyle = Style(tcell.StyleDefault.Background(tcell.ColorReset).Foreground(tcell.ColorReset))
+ BgStyle = Style(tcell.StyleDefault.Foreground(tcell.ColorReset).Background(tcell.ColorReset))
FgStyle = Style(tcell.StyleDefault.Foreground(tcell.ColorWhite).Background(tcell.ColorOlive))
}
diff --git a/internal/term/screen.go b/internal/term/screen.go
index fc1555f..dedacd0 100644
--- a/internal/term/screen.go
+++ b/internal/term/screen.go
@@ -34,8 +34,7 @@ func (scr *Screen) Size() (int, int) {
}
func (scr *Screen) Clear(style Style) {
- scr.scr.SetStyle(tcell.Style(style))
- scr.scr.Clear()
+ scr.scr.Fill(' ', tcell.Style(style))
}
func (scr *Screen) OnResize(handler func() bool) {