Tidy views
This commit is contained in:
18
src/views/icon.rs
Normal file
18
src/views/icon.rs
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user