GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
refactor(widget)!: DELETE Container — both consumers dissolved (Phase 6ax part 2)
cce-system-settings' system-info actions_row was a dead field (declared
+ initialized, never read — same shape as the SectionContainer layer
deleted in 6as), and cce-display-manager's root_container was a
transparent, zero-origin event/walk root whose only real work was
fanning out to the card and the session list. With both dissolved
app-side, the type had no constructor left and is deleted.
168 tests pass; full workspace builds. dm A/B: static diff is the
full-frame background animation's phase (B-vs-B control differs across
the whole window; element positions identical); session-list click
behavior matches baseline exactly (selection highlight does not move on
either build — pre-existing); 3/3 interaction rounds alive on both
builds. One unreproduced bogus-alloc crash was seen once on the new
build (dm's known latent stale-pointer signature, 0/3 repro on either
binary afterwards) — flagged, not a confirmed regression.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk
src/widget/container/container.rs | 85 ---------------------------------------
src/widget/container/mod.rs | 2 -
src/widget/mod.rs | 2 +-
3 files changed, 1 insertion(+), 88 deletions(-)
diff --git a/src/widget/container/container.rs b/src/widget/container/container.rs
deleted file mode 100644
index 05fc52f..0000000
--- a/src/widget/container/container.rs
+++ /dev/null
@@ -1,85 +0,0 @@
-use crate::widget::*;
-use super::container_layout::{ContainerLayout, OverlayLayout};
-
-#[derive(Clone)]
-pub struct Container {
- pub parent: Option<*mut (dyn Element + 'static)>,
- pub children: Vec<*mut (dyn Element + 'static)>,
- pub base: Widget,
- pub layout: Box<dyn ContainerLayout>,
-}
-
-impl Container {
- pub fn new() -> Self {
- Self {
- parent: None,
- children: Vec::new(),
- base: Widget::new(),
- layout: Box::new(OverlayLayout::default()),
- }
- }
-
- pub fn with_layout<L: ContainerLayout + 'static>(mut self, layout: L) -> Self {
- self.layout = Box::new(layout);
- self
- }
-}
-
-impl Element for Container {
- fn base(&self) -> Option<&Widget> { Some(&self.base) }
- fn blocks_backplate_drag(&self) -> bool { false }
- fn base_mut(&mut self) -> Option<&mut Widget> { Some(&mut self.base) }
- fn color(&self) -> [f32; 4] { [0.0, 0.0, 0.0, 0.0] }
- fn as_ptr(&self) -> *mut (dyn Element + 'static) {
- self as *const Self as *mut Self as *mut (dyn Element + 'static)
- }
- fn as_ptr_mut(&mut self) -> *mut (dyn Element + 'static) {
- self as *mut Self as *mut (dyn Element + 'static)
- }
-
- fn set_rect(&mut self, x: f32, y: f32, w: f32, h: f32) {
- let dx = x - self.base.x;
- let dy = y - self.base.y;
-
- self.base.x = x;
- self.base.y = y;
- self.base.w = w;
- self.base.h = h;
-
- if dx.abs() > 0.001 || dy.abs() > 0.001 {
- for &child in &self.children {
- unsafe {
- let (cx, cy, cw, ch) = (*child).rect();
- (*child).set_rect(cx + dx, cy + dy, cw, ch);
- }
- }
- }
- }
-
- fn measure(&self, constraints: LayoutConstraints, ctx: &UiContext) -> Size {
- self.layout.measure(constraints, &self.children, ctx)
- }
-
- fn layout(&mut self, origin: Point, constraints: LayoutConstraints, ctx: &mut UiContext) {
- let size = self.measure(constraints, ctx);
- self.set_rect(origin.x, origin.y, size.width, size.height);
- self.layout.layout(origin.x, origin.y, size.width, size.height, &self.children, ctx);
- }
-
- fn focus(&mut self) {
- focus::set_focused(self);
- }
- fn unfocus(&mut self) {}
-
- fn parent(&self, _ctx: &UiContext) -> Option<*mut (dyn Element + 'static)> { self.parent }
- fn set_parent(&mut self, parent: Option<*mut (dyn Element + 'static)>, _ctx: &mut UiContext) { self.parent = parent; }
- 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(); }
-}
-
-impl Drop for Container {
- fn drop(&mut self) {
- clear_widget_references(self);
- }
-}
diff --git a/src/widget/container/mod.rs b/src/widget/container/mod.rs
index 6ffeacd..7b02c32 100644
--- a/src/widget/container/mod.rs
+++ b/src/widget/container/mod.rs
@@ -1,4 +1,3 @@
-pub mod container;
pub mod container_layout;
pub mod content_bg;
pub mod parameters_bg;
@@ -9,7 +8,6 @@ pub mod scroll_box;
pub mod paginator;
pub mod treelist;
-pub use container::Container;
pub use container_layout::{ContainerLayout, OverlayLayout, ManualLayout, VerticalLayout, GridLayout, AdaptiveGridLayout, ColumnsLayout, MosaicLayout, ReverseMosaicLayout};
pub use content_bg::ContentBg;
pub use parameters_bg::ParametersBg;
diff --git a/src/widget/mod.rs b/src/widget/mod.rs
index f7444f0..a83d088 100644
--- a/src/widget/mod.rs
+++ b/src/widget/mod.rs
@@ -723,7 +723,7 @@ pub use self::input::{
ButtonStrip, KeybindRecorder, Ramp, RampKey, ColorRamp, ColorRampKey
};
pub use self::container::{
- Container, ContainerLayout, OverlayLayout, ManualLayout, VerticalLayout, GridLayout, AdaptiveGridLayout,
+ ContainerLayout, OverlayLayout, ManualLayout, VerticalLayout, GridLayout, AdaptiveGridLayout,
ColumnsLayout, MosaicLayout, ReverseMosaicLayout,
ContentBg, ParametersBg,
ScrollBox, MenuBar, Spreadsheet, Breadcrumb,