iced_pancurses/renderer/
scrollable.rs

1use crate::primitive::Primitive;
2use crate::PancursesRenderer;
3
4use iced_native::widget::scrollable;
5use iced_native::{Point, Rectangle};
6
7impl scrollable::Renderer for PancursesRenderer {
8    /*
9    fn scrollbar(
10        &self,
11        bounds: Rectangle,
12        content_bounds: Rectangle,
13        offset: u32,
14    ) -> Option<scrollable::Scrollbar> {
15        None
16    }
17    */
18
19    fn is_mouse_over_scrollbar(
20        &self,
21        _bounds: Rectangle,
22        _content_bounds: Rectangle,
23        _cursor_position: Point,
24    ) -> bool {
25        false
26    }
27
28    fn draw(
29        &mut self,
30        _state: &scrollable::State,
31        bounds: Rectangle,
32        _content_bounds: Rectangle,
33        _is_mouse_over: bool,
34        _is_mouse_over_scrollbar: bool,
35        offset: u32,
36        content: Primitive,
37    ) -> Primitive {
38        Primitive::Group(vec![
39            Primitive::BoxDisplay(bounds),
40            content.with_offset(offset as i32),
41        ])
42    }
43}