GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
feat: a slider's hover can be set by its host
For a host that paints one slider as a stamp over several rows and does
its own hit-testing.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
src/widget/input/slider.rs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/widget/input/slider.rs b/src/widget/input/slider.rs
index 10783f4..528725a 100644
--- a/src/widget/input/slider.rs
+++ b/src/widget/input/slider.rs
@@ -228,6 +228,13 @@ impl Slider {
self.hovered
}
+ /// Set the hover directly, for a host that paints one slider as a STAMP
+ /// over several rows and does its own hit-testing — the designer's
+ /// dialog — rather than routing `MouseEnter` / `MouseLeave` to it.
+ pub fn set_hovered(&mut self, hovered: bool) {
+ self.hovered = hovered;
+ }
+
fn scaled_string(&self) -> String {
format!("{:.*}", self.decimals, self.min + self.value * (self.max - self.min))
}