iced_pancurses/renderer/
image.rs1use crate::primitive::Primitive;
2use crate::PancursesRenderer;
3use iced_native::widget::image;
4use iced_native::{Font, HorizontalAlignment, Layout, VerticalAlignment};
5
6impl image::Renderer for PancursesRenderer {
9 fn dimensions(&self, _path: &str) -> (u32, u32) {
10 (15, 5)
11 }
12
13 fn draw(&mut self, _path: &str, layout: Layout) -> Primitive {
14 let mut bounds = layout.bounds();
15 bounds.x += 1.;
16 bounds.y += 1.;
17 let prim_text = <Self as iced_native::widget::text::Renderer>::draw(
18 self,
19 bounds,
20 "Unsupported",
21 1,
22 Font::Default,
23 None,
24 HorizontalAlignment::Center,
25 VerticalAlignment::Center,
26 );
27 Primitive::Group(vec![Primitive::BoxDisplay(layout.bounds()), prim_text])
28 }
29}