22 lines
586 B
Rust
22 lines
586 B
Rust
use buoyant::view::View;
|
|
use buoyant::view::ViewExt;
|
|
use buoyant::view::ZStack;
|
|
use buoyant::view::shape::Rectangle;
|
|
use embedded_graphics::pixelcolor::Rgb565;
|
|
|
|
use crate::BACKGROUND_COLOR;
|
|
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(BACKGROUND_COLOR),
|
|
buoyant::view::Image::new(get_image!(icon)),
|
|
))
|
|
.flex_frame()
|
|
.with_max_size(53, 53)
|
|
.with_min_size(53, 53)
|
|
}
|