git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit4df3ec20cc470ab24ded4cd2e820e1c9acc18cb4
parent478aaebf8f
authorLucas Galante <[email protected]>
date2026-08-01 22:58
feat: SectionContext::well_top() — the content-box top edge for exact insets

Relief styling: the body well's top (the tab's bottom); outline: the
border line. Lets a page place content at a uniform inset from the
well's walls.

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

 src/layout.rs | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/layout.rs b/src/layout.rs
index f960af0..94c600c 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -5014,6 +5014,15 @@ impl<'a, P: RenderTarget> SectionContext<'a, P> {
         self
     }
 
+    /// The section's content-box top edge: the body well's top (the tab's
+    /// bottom) under relief styling, the outline's border line otherwise. Lets
+    /// a page place content at an exact inset from the well's walls.
+    pub fn well_top(&self) -> f32 {
+        self.relief_tab
+            .map(|t| t.1 + t.3)
+            .unwrap_or(self.top + 7.0)
+    }
+
     pub fn set_row_gap(&mut self, gap: f32) {
         self.row_gap = gap;
     }