From 0d0186d63712472a037cf510812e68774c73c12f Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Mon, 17 Mar 2025 16:58:07 +0100 Subject: Add initial support for damage tracking This also fixes a styling issue when the widget styles its own text. --- cmd/list.ha | 2 ++ cmd/text.ha | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'cmd') diff --git a/cmd/list.ha b/cmd/list.ha index 1db46b4..348083e 100644 --- a/cmd/list.ha +++ b/cmd/list.ha @@ -15,6 +15,8 @@ export fn main() void = { colorfg = widget::color::REDFG, colorbg = widget::color::REDBG, },"hello", "world", "bye", "world")!; + let l = layout::newvlayout(&li); + defer l.layout.finish(&l); l.layout.print(&l); }; diff --git a/cmd/text.ha b/cmd/text.ha index f7ce1fc..7c569a8 100644 --- a/cmd/text.ha +++ b/cmd/text.ha @@ -17,7 +17,7 @@ export fn main() void = { let l = layout::newvlayout(&txt); l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); let st = txt.widget.style as *widget::style; @@ -25,37 +25,37 @@ export fn main() void = { text::settext(&txt, "bye world"); l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::BROWNFG; l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::BLUEFG; l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::MAGENTAFG; l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::CYANFG; l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::WHITEFG; l.layout.print(&l); - tui::clear(&state); + //tui::clear(&state); time::sleep(1 * time::SECOND); st.colorfg = widget::color::DEFAULTFG; -- cgit v1.2.3