Tidy views

This commit is contained in:
2025-11-28 18:32:28 +01:00
parent b46666a703
commit 0a183e7b3e
13 changed files with 214 additions and 119 deletions

18
src/views/icon.rs Normal file
View File

@ -0,0 +1,18 @@
use buoyant::view::View;
use buoyant::view::ViewExt;
use buoyant::view::ZStack;
use buoyant::view::shape::Rectangle;
use embedded_graphics::pixelcolor::Rgb565;
use crate::get_image;
use crate::images::StaticImage;
pub fn icon_box_view(box_color: Rgb565, icon: &'static StaticImage) -> impl View<Rgb565> {
ZStack::new((
Rectangle.corner_radius(10).foreground_color(box_color),
buoyant::view::Image::new(get_image!(icon)),
))
.flex_frame()
.with_max_size(53, 53)
.with_min_size(53, 53)
}