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

commitb5a41bc752f1b053e5233ee10db3646be84336d0
parent5b74c6bcbc
authorLucas Galante <[email protected]>
date2026-07-11 17:43
refactor(widget): delete five call-less Element methods (Phase 6as prep)

Element::paint (the hover-registration default nothing ever invoked),
as_geom_controller / as_spreadsheet_controller (& variants — only the _mut
pairs have callers), color_u8, is_layer — plus their impls (Adapted,
Layer, ColorSelector). Census: 117 trait methods, these five had zero
call sites workspace-wide.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018u7qTwzX95dd5ysAkaSCLk

 src/widget/container/layer.rs      |  1 -
 src/widget/input/color_selector.rs |  3 ---
 src/widget/mod.rs                  | 11 -----------
 src/widget/model.rs                |  6 ------
 4 files changed, 21 deletions(-)

diff --git a/src/widget/container/layer.rs b/src/widget/container/layer.rs
index 1205245..3e8bc42 100644
--- a/src/widget/container/layer.rs
+++ b/src/widget/container/layer.rs
@@ -30,7 +30,6 @@ impl Layer {
 
 impl Element for Layer {
     fn base(&self) -> Option<&Widget> { Some(&self.base) }
-    fn is_layer(&self) -> bool { true }
     fn blocks_backplate_drag(&self) -> bool { false }
 
     fn base_mut(&mut self) -> Option<&mut Widget> { Some(&mut self.base) }
diff --git a/src/widget/input/color_selector.rs b/src/widget/input/color_selector.rs
index 1de877d..7503f4a 100644
--- a/src/widget/input/color_selector.rs
+++ b/src/widget/input/color_selector.rs
@@ -175,9 +175,6 @@ impl Element for ColorSelector {
         Some(self.font_family.clone())
     }
 
-    fn color_u8(&self) -> Option<[u8; 4]> {
-        Some([self.color[0], self.color[1], self.color[2], self.alpha])
-    }
 
     fn color(&self) -> [f32; 4] {
         colors::to_linear([
diff --git a/src/widget/mod.rs b/src/widget/mod.rs
index b442da4..feff48b 100644
--- a/src/widget/mod.rs
+++ b/src/widget/mod.rs
@@ -559,13 +559,6 @@ pub trait Element {
         quads
     }
 
-    fn paint(&mut self, ctx: &mut UiContext) {
-        if let Some(hq) = self.highlight_quad(ctx) {
-            if hq.4 == colors::HIGHLIGHT_SECONDARY {
-                ctx.register_hovered(hq.0, hq.1, hq.2, hq.3, hq.4);
-            }
-        }
-    }
 
     // The per-widget text getters (text_labels / text_labels_with_bounds /
     // text_labels_with_font_and_bounds / get_text_items) are GONE: every widget emits
@@ -620,13 +613,11 @@ pub trait Element {
     fn as_menu_controller_mut(&mut self) -> Option<&mut dyn MenuController> { None }
     fn as_graph_controller(&self) -> Option<&dyn GraphController> { None }
     fn as_graph_controller_mut(&mut self) -> Option<&mut dyn GraphController> { None }
-    fn as_spreadsheet_controller(&self) -> Option<&dyn SpreadsheetController> { None }
     fn as_spreadsheet_controller_mut(&mut self) -> Option<&mut dyn SpreadsheetController> { None }
     fn as_path_controller(&self) -> Option<&dyn PathController> { None }
     fn as_path_controller_mut(&mut self) -> Option<&mut dyn PathController> { None }
     fn as_param_controller(&self) -> Option<&dyn ParamController> { None }
     fn as_param_controller_mut(&mut self) -> Option<&mut dyn ParamController> { None }
-    fn as_geom_controller(&self) -> Option<&dyn GeomController> { None }
     fn as_geom_controller_mut(&mut self) -> Option<&mut dyn GeomController> { None }
 
     fn parent(&self, ctx: &UiContext) -> Option<*mut (dyn Element + 'static)> {
@@ -681,7 +672,6 @@ pub trait Element {
     fn z_index(&self) -> i32 { 0 }
     fn is_plate(&self) -> bool { false }
     fn is_page(&self) -> bool { false }
-    fn is_layer(&self) -> bool { false }
     fn is_backplate(&self) -> bool { false }
     fn is_movable_backplate(&self) -> bool { false }
     fn is_scrollable(&self) -> bool { false }
@@ -701,7 +691,6 @@ pub trait Element {
         )
     }
     fn layout_ignore(&self) -> bool { false }
-    fn color_u8(&self) -> Option<[u8; 4]> { None }
 }
 
 pub trait Control: Element {
diff --git a/src/widget/model.rs b/src/widget/model.rs
index 1aae19a..029088a 100644
--- a/src/widget/model.rs
+++ b/src/widget/model.rs
@@ -1491,9 +1491,6 @@ impl<W: Layout + Paint + Input + 'static> Element for Adapted<W> {
     fn as_graph_controller_mut(&mut self) -> Option<&mut dyn GraphController> {
         Input::graph_controller_mut(&mut self.inner)
     }
-    fn as_spreadsheet_controller(&self) -> Option<&dyn SpreadsheetController> {
-        Input::spreadsheet_controller(&self.inner)
-    }
     fn as_spreadsheet_controller_mut(&mut self) -> Option<&mut dyn SpreadsheetController> {
         Input::spreadsheet_controller_mut(&mut self.inner)
     }
@@ -1509,9 +1506,6 @@ impl<W: Layout + Paint + Input + 'static> Element for Adapted<W> {
     fn as_param_controller_mut(&mut self) -> Option<&mut dyn ParamController> {
         Input::param_controller_mut(&mut self.inner)
     }
-    fn as_geom_controller(&self) -> Option<&dyn GeomController> {
-        Input::geom_controller(&self.inner)
-    }
     fn as_geom_controller_mut(&mut self) -> Option<&mut dyn GeomController> {
         Input::geom_controller_mut(&mut self.inner)
     }