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

commit71cb920c323dd72288992ea14ae8967ee9676977
parentb4f5aaa583
authorLucas Galante <[email protected]>
date2026-06-28 07:26
Implement layout_ignore for interactive controls to prevent Plate concentric ring layout overrides

 src/widget/container/scroll_box.rs | 4 ++++
 src/widget/input/button.rs         | 4 ++++
 src/widget/input/dropdown.rs       | 4 ++++
 src/widget/input/slider.rs         | 4 ++++
 4 files changed, 16 insertions(+)

diff --git a/src/widget/container/scroll_box.rs b/src/widget/container/scroll_box.rs
index 9f2d1b9..541fb01 100644
--- a/src/widget/container/scroll_box.rs
+++ b/src/widget/container/scroll_box.rs
@@ -227,6 +227,10 @@ impl Element for ScrollBox {
     fn children(&self, _ctx: &UiContext) -> Vec<*mut (dyn Element + 'static)> { self.children.clone() }
     fn add_child(&mut self, child: *mut (dyn Element + 'static), _ctx: &mut UiContext) { self.children.push(child); }
     fn clear_children(&mut self, _ctx: &mut UiContext) { self.children.clear(); }
+
+    fn layout_ignore(&self) -> bool {
+        true
+    }
 }
 
 impl Drop for ScrollBox {
diff --git a/src/widget/input/button.rs b/src/widget/input/button.rs
index a4caef8..1042c6e 100644
--- a/src/widget/input/button.rs
+++ b/src/widget/input/button.rs
@@ -293,6 +293,10 @@ impl Element for Button {
     fn corner_radius(&self) -> f32 {
         crate::layout::button_corner_radius()
     }
+
+    fn layout_ignore(&self) -> bool {
+        true
+    }
 }
 
 pub enum PageButton {
diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index 6cda685..1fc72c0 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -395,6 +395,10 @@ impl Element for Dropdown {
     fn render_popover(&self, pc: &mut dyn crate::layout::RenderTarget) {
         Dropdown::render_popover(self, pc);
     }
+
+    fn layout_ignore(&self) -> bool {
+        true
+    }
 }
 
 impl Drop for Dropdown {
diff --git a/src/widget/input/slider.rs b/src/widget/input/slider.rs
index 08c4f9e..6bccca5 100644
--- a/src/widget/input/slider.rs
+++ b/src/widget/input/slider.rs
@@ -466,6 +466,10 @@ impl Element for Slider {
     }
 
     fn value(&self) -> i32 { (self.value * 100.0) as i32 }
+
+    fn layout_ignore(&self) -> bool {
+        true
+    }
 }
 
 impl Drop for Slider {