use rust_on_rails::prelude::*;
use crate::PelicanUI;
#[derive(Clone, Debug)]
pub struct Icon;
impl OnEvent for Icon {}
impl Icon {
#[allow(clippy::new_ret_no_self)]
pub fn new(ctx: &mut Context, name: &'static str, color: Color, size: f32) -> Image {
let icon = ctx.get::<PelicanUI>().theme.icons.get(name);
Image{shape: ShapeType::Rectangle(0.0, (size, size)), image: icon, color: Some(color)}
}
}
#[derive(Clone, Debug)]
pub struct Brand;
impl OnEvent for Brand {}
impl Brand {
#[allow(clippy::new_ret_no_self)]
pub fn new(image: resources::Image, size: (f32, f32)) -> Image {
Image{shape: ShapeType::Rectangle(0.0, (size.0, size.1)), image, color: None}
}
}