use fission::prelude::*;
#[derive(Clone, Copy)]
pub(crate) struct SpotlightFocusRing {
pub color: Color,
pub width: f32,
}
impl From<SpotlightFocusRing> for Widget {
fn from(ring: SpotlightFocusRing) -> Self {
let strip = || {
Container::new(Spacer::default())
.bg(ring.color)
.border_radius(ring.width * 0.5)
.into()
};
ZStack {
id: None,
children: widgets![
Positioned {
left: Some(0.0),
top: Some(0.0),
right: Some(0.0),
height: Some(ring.width),
child: Some(strip()),
..Default::default()
},
Positioned {
left: Some(0.0),
right: Some(0.0),
bottom: Some(0.0),
height: Some(ring.width),
child: Some(strip()),
..Default::default()
},
Positioned {
left: Some(0.0),
top: Some(ring.width),
bottom: Some(ring.width),
width: Some(ring.width),
child: Some(strip()),
..Default::default()
},
Positioned {
top: Some(ring.width),
right: Some(0.0),
bottom: Some(ring.width),
width: Some(ring.width),
child: Some(strip()),
..Default::default()
},
],
}
.into()
}
}