T09b overlays: lightbox, spotlight and tour, floating toolbar, peek; images fill their box; overlays take focus back when its element leaves the tree

This commit is contained in:
ZacharyZhang-NY committed 2026-09-25 15:19:57 -04:00
1 parent ca73d24c01
commit ef74bac823
18 files changed
+1754 -228

No files matched your search

+4 -2
View File
@@ -13,7 +13,7 @@ use crate::{
const PULSE: Duration = Duration::from_millis(1600);
/// Themed `img()`; a `Cover` crop keeps square corners.
/// Themed `img()` that fills the box it is given; a `Cover` crop keeps square corners.
#[derive(IntoElement)]
pub struct Image {
id: ElementId,
@@ -82,6 +82,8 @@ impl RenderOnce for Image {
};
let mut picture = img(source)
.id(self.id)
.absolute()
.inset_0()
.size_full()
.object_fit(self.fit)
.with_loading(move || {
@@ -100,6 +102,6 @@ impl RenderOnce for Image {
})
.with_fallback(move || mark(IconName::ImageOff).into_any_element());
picture.style().corner_radii = radii;
self.base.overflow_hidden().child(picture)
self.base.relative().overflow_hidden().child(picture)
}
}