git.lucas.co / cce-system-interface
system settings
git clone https://git.lucas.co/cce-system-interface.git

commit0df00b64c9c2d3f4ffb440a0c6a8bfdc42b5dfd3
parent980a13ff52
authorLucas Galante <[email protected]>
date2026-07-07 21:44
feat: render via the single paint path by default (flat-list bridge, Phase 3)

This app flattens its UI into a flat quad list (built by rebuild_layout) rather than walking a widget tree. display_list() builds the DisplayList directly from that list (rounded_rect / quad per widget, matching the legacy radius>0.1 split, plus the hover highlight) — the flat-list bridge for PageContent-style apps. Fifth app on the Phase 3 single paint path; CCE_LEGACY_PAINT falls back. Self-verified by screenshot: account buttons, section frames, labels and page dropdown all render correctly.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

 src/main.rs | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/main.rs b/src/main.rs
index 4ff1e4a..907b52b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -303,6 +303,31 @@ impl cce_ui::engine::Application for SystemInterface {
         }
     }
 
+    fn display_list(&mut self) -> Option<cce_ui::scene::paint::DisplayList> {
+        // Phase 3 single paint path. This app flattens its UI into a `widgets` quad list (rebuilt
+        // by view_rounded_quads, which runs before this), so build the DisplayList directly from
+        // that list — the flat-list bridge. CCE_LEGACY_PAINT falls back.
+        if std::env::var("CCE_LEGACY_PAINT").is_ok() {
+            return None;
+        }
+        use cce_ui::scene::layout::Rect;
+        let mut pc = cce_ui::scene::paint::PaintCtx::new();
+        for w in &self.widgets {
+            let color = if w.hovering { w.hover_color } else { w.color };
+            let rect = Rect { x: w.x, y: w.y, width: w.w, height: w.h };
+            if w.radius > 0.1 {
+                pc.rounded_rect(rect, w.radius, w.corners, color);
+            } else {
+                pc.quad(rect, color);
+            }
+        }
+        cce_ui::widget::hover_animation::post_render_check();
+        if let Some((qx, qy, qw, qh, qc)) = cce_ui::widget::hover_animation::get_quad() {
+            pc.quad(Rect { x: qx, y: qy - self.scroll_y, width: qw, height: qh }, qc);
+        }
+        Some(pc.finish())
+    }
+
     fn text_items(&self) -> &[cce_ui::widget::TextItem] {
         &self.text_items
     }