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

commitcd1cba87763021a71b9b70987c6f62ba1312b054
parentab0ae22069
authorLucas Galante <[email protected]>
date2026-08-20 16:03
Carve control troughs and popover plates from the inset_plate hook

PageContent implements RenderTarget::inset_plate: widget-pass claims
(each Dropdown's flush inset trough, offered by cce-ui's flat bridge)
collect into control_reliefs and carve after the section wells, clipped
to the page viewport and scroll-shifted like them; popover-pass claims
(the dropdown's grown-trigger menu plate) collect separately and render
at the popover layer, over the page — without this split the open
menu's opaque plate either vanished (the hook diverted what used to
degrade into popover_pc.rects) or would shade under the page carves.

Every dropdown page picks the treatment up with no page changes —
verified on Default Apps (troughs around all nine rows, open menu plate
intact over them) and Fonts (the Borders dropdown, nested in its
section well).

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/app.rs      | 25 ++++++++++++++++++++++++-
 src/main.rs     | 43 +++++++++++++++++++++++++++++++++++++++++++
 src/renderer.rs |  5 +++++
 3 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/src/app.rs b/src/app.rs
index ed6a453..1895302 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -135,6 +135,11 @@ pub struct PageContent {
     /// plus the title tab box, carved into the window plate by display_list as
     /// recess prims (page coordinates, pre-scroll).
     pub reliefs: Vec<((f32, f32, f32, f32), Option<(f32, f32, f32, f32)>)>,
+    /// Control troughs claimed via `RenderTarget::inset_plate` (the flat-path
+    /// bridge offers a Dropdown's flush inset chrome here) — (x, y, w, h,
+    /// radius, depth, face color), page coordinates, pre-scroll; display_list
+    /// carves them as real inset plates.
+    pub control_reliefs: Vec<(f32, f32, f32, f32, f32, f32, [f32; 4])>,
     pub clip_stack: Vec<[f32; 4]>,
     pub measure_only: bool,
 }
@@ -146,6 +151,7 @@ impl Default for PageContent {
             texts: Vec::new(),
             buttons: Vec::new(),
             reliefs: Vec::new(),
+            control_reliefs: Vec::new(),
             clip_stack: Vec::new(),
             measure_only: true,
         }
@@ -154,7 +160,15 @@ impl Default for PageContent {
 
 impl PageContent {
     pub fn new() -> Self {
-        Self { rects: Vec::new(), texts: Vec::new(), buttons: Vec::new(), reliefs: Vec::new(), clip_stack: Vec::new(), measure_only: false }
+        Self {
+            rects: Vec::new(),
+            texts: Vec::new(),
+            buttons: Vec::new(),
+            reliefs: Vec::new(),
+            control_reliefs: Vec::new(),
+            clip_stack: Vec::new(),
+            measure_only: false,
+        }
     }
 
     fn get_clipped_rect(&self, x: f32, y: f32, w: f32, h: f32) -> Option<(f32, f32, f32, f32)> {
@@ -290,6 +304,15 @@ impl RenderTarget for PageContent {
         cce_ui::layout::control_relief()
     }
 
+    /// The flat-path bridge offers each Dropdown's flush inset trough here;
+    /// carve it for real (display_list turns these into inset plates).
+    fn inset_plate(&mut self, color: [f32; 4], x: f32, y: f32, w: f32, h: f32, radius: f32, depth: f32) {
+        if self.measure_only {
+            return;
+        }
+        self.control_reliefs.push((x, y, w, h, radius, depth, color));
+    }
+
     fn section_relief(&mut self, f: &cce_ui::layout::SectionFrame) -> bool {
         // Focused sections keep the legacy green outline (the ctrl-nav feedback);
         // relief-off styling keeps the outline everywhere.
diff --git a/src/main.rs b/src/main.rs
index 2015c09..8cb56be 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -44,6 +44,9 @@ struct SystemInterface {
     // scrolls them.
     popover_widgets: Vec<AppWidget>,
     popover_texts: Vec<(String, f32, f32, f32, [f32; 4], Option<String>, Option<[f32; 4]>)>,
+    /// Popover-layer inset plates (window coords, scroll already applied) —
+    /// the dropdown's grown-trigger surface via the inset_plate hook.
+    popover_control_reliefs: Vec<(f32, f32, f32, f32, f32, f32, [f32; 4])>,
     page_buttons: Vec<(cce_ui::widget::Adapted<cce_ui::widget::Button>, AppAction)>,
 
     sidebar_width: f32,
@@ -103,6 +106,9 @@ struct SystemInterface {
     // Section wells: body box + title tab (page coords, pre-scroll) — carved by
     // display_list.
     page_reliefs: Vec<((f32, f32, f32, f32), Option<(f32, f32, f32, f32)>)>,
+    /// Control troughs from `PageContent::control_reliefs` (page coords,
+    /// pre-scroll) — each carved as a flush inset plate after the section wells.
+    page_control_reliefs: Vec<(f32, f32, f32, f32, f32, f32, [f32; 4])>,
     // Root Backplate + StatusBar DISSOLVED (Phase 6s): the window plate and the status
     // bar are emitted as tuples in rebuild_layout.
     sans_serif_family: String,
@@ -155,6 +161,7 @@ impl cce_ui::engine::Application for SystemInterface {
             texts: Vec::new(),
             popover_widgets: Vec::new(),
             popover_texts: Vec::new(),
+            popover_control_reliefs: Vec::new(),
             page_buttons: Vec::new(),
             sidebar_width,
             header_height: 0.0,
@@ -197,6 +204,7 @@ impl cce_ui::engine::Application for SystemInterface {
             page_scroll_bar: crate::scroll_bar::ScrollBar::new(),
             content_h: 0.0,
             page_reliefs: Vec::new(),
+            page_control_reliefs: Vec::new(),
             sans_serif_family: sans_family,
             serif_family,
             monospace_family,
@@ -399,6 +407,30 @@ impl cce_ui::engine::Application for SystemInterface {
             });
         }
 
+        // Control troughs (Dropdown flush inset chrome, offered by the flat
+        // bridge): carved after the section wells so they shade the fills
+        // beneath, clipped to the page viewport like the wells.
+        if !self.page_control_reliefs.is_empty() {
+            let view = Rect {
+                x: self.sidebar_width,
+                y: self.header_height,
+                width: width - self.sidebar_width,
+                height: (height - self.header_height - self.status_height
+                    - if self.search_open { 42.0 } else { 0.0 }).max(0.0),
+            };
+            let scroll_y = self.scroll_y;
+            pc.clip(view, |pc| {
+                for &(x, y, w, h, radius, depth, color) in &self.page_control_reliefs {
+                    pc.inset_plate(
+                        Rect { x, y: y - scroll_y, width: w, height: h },
+                        (radius, radius, radius, radius),
+                        color,
+                        depth,
+                    );
+                }
+            });
+        }
+
         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);
@@ -411,6 +443,17 @@ impl cce_ui::engine::Application for SystemInterface {
                 pc.quad(rect, w.color);
             }
         }
+        // Popover surfaces claimed through the inset_plate hook (the dropdown's
+        // grown-trigger plate): real relief prims at the popover layer, over
+        // the page and its control troughs.
+        for &(x, y, w, h, radius, depth, color) in &self.popover_control_reliefs {
+            pc.inset_plate(
+                Rect { x, y, width: w, height: h },
+                (radius, radius, radius, radius),
+                color,
+                depth,
+            );
+        }
         for (text, font_size, x, y, col, font, bounds) in self.texts.iter().chain(self.popover_texts.iter()) {
             pc.text_with(
                 text.clone(),
diff --git a/src/renderer.rs b/src/renderer.rs
index 7d04a3a..aa280aa 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -263,6 +263,7 @@ impl SystemInterface {
         // Page content in LOGICAL coordinates, then scale to physical
         let pc = self.render_page_content(lcx, lcy, lcw, lch);
         self.page_reliefs = pc.reliefs.clone();
+        self.page_control_reliefs = pc.control_reliefs.clone();
 
 
 
@@ -601,6 +602,9 @@ impl SystemInterface {
                 let shifted = bounds.map(|[l, tb, rr, b]| [l, tb - self.scroll_y, rr, b - self.scroll_y]);
                 popover_pc.texts.push((t, size, x, y - self.scroll_y, tc, font, shifted));
             }
+            for (x, y, w, h, r, d, c) in page_pop_pc.control_reliefs {
+                popover_pc.control_reliefs.push((x, y - self.scroll_y, w, h, r, d, c));
+            }
         }
         if cce_ui::widget::context_menu::is_visible() {
             use cce_ui::layout::RenderTarget;
@@ -637,6 +641,7 @@ impl SystemInterface {
             corners: *corners,
         }).collect();
         self.popover_texts = popover_pc.texts;
+        self.popover_control_reliefs = popover_pc.control_reliefs;
 
         self.widgets = widgets;
         self.texts = texts;