iced-pancurses 0.1.2

Toy renderer for iced based on pancurses
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::PancursesRenderer;
use iced_native::renderer::Debugger;
use iced_native::{Layout, Color, Point};

impl Debugger for PancursesRenderer {
    fn explain<Message>(&mut self, widget: &dyn Widget<Message, Self>, layout: Layout, cursor_position: Point, color: Color) {
        let bounds = layout.bounds();
        if let Ok(sub_win) = self.window.subwin(
            bounds.height as i32,
            bounds.width as i32,
            bounds.y as i32,
            bounds.x as i32,
        ) {
            sub_win.border(0, 0, 0, 0, 0, 0, 0, 0);
            sub_win.delwin();
        }
    }
}