use euclid::Size2D;
use crate::{event::Event, unit::Cell, Printer, View as ViewTrait};
pub struct View;
pub fn new() -> View {
View
}
impl<T, M> ViewTrait<T, M> for View
where
M: 'static,
{
fn draw(&self, _printer: &Printer, _focused: bool) {
}
fn width(&self) -> Size2D<u16, Cell> {
(1, 1).into()
}
fn height(&self) -> Size2D<u16, Cell> {
(1, 1).into()
}
fn layout(&self, _constraint: Size2D<u16, Cell>) -> Size2D<u16, Cell> {
(1, 1).into()
}
fn event(
&mut self,
_event: &Event<T>,
_focused: bool,
) -> Box<dyn Iterator<Item = M>> {
Box::new(std::iter::empty())
}
fn interactive(&self) -> bool {
false
}
}