git.lucas.co / cce-files
file manager
git clone https://git.lucas.co/cce-files.git

commitc5f765b1fbe331f0c13328f0ef4ac1b395984c5b
parent261b3b7ee9
authorLucas Galante <[email protected]>
date2026-07-07 21:48
feat: render the browse page via the single paint path by default (Phase 3)

cce-files flattens every render source (browse/network page, preview, popovers, context menu, dialogs) into a single AppWidget quad list via rebuild_layout. display_list() builds the DisplayList straight from that flat list (rounded_rect for radius>0.1 else quad) — the flat-list bridge. Sixth app on the Phase 3 single paint path; CCE_LEGACY_PAINT falls back. Self-verified by screenshot: breadcrumb + view dropdown (no stray rectangle), file list, source preview and details pane all render correctly.

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

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

diff --git a/src/main.rs b/src/main.rs
index be4cb08..4f508fd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1176,6 +1176,27 @@ impl Application for FilesystemApp {
         }
     }
 
+    fn display_list(&mut self) -> Option<cce_ui::scene::paint::DisplayList> {
+        // Phase 3 single paint path (flat-list bridge). rebuild_layout flattens every source
+        // (browse/network page, popovers, context menu, dialogs) into self.widgets, which
+        // view_rounded_quads runs above — so build the DisplayList straight from that list.
+        // 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 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, w.color);
+            } else {
+                pc.quad(rect, w.color);
+            }
+        }
+        Some(pc.finish())
+    }
+
     fn text_items(&self) -> &[TextItem] {
         &self.text_items
     }