@@ -1,36 +0,0 @@
1−use crate::buffer::Buffer;
2−use crate::layout::Rect;
3−use crate::widgets::Widget;
4−
5−/// A widget to to clear/reset a certain area to allow overdrawing (e.g. for popups)
6−///
7−/// # Examples
8−///
9−/// ```
10−/// # use helix_tui::widgets::{Clear, Block, Borders};
11−/// # use helix_tui::layout::Rect;
12−/// # use helix_tui::Frame;
13−/// # use helix_tui::backend::Backend;
14−/// fn draw_on_clear<B: Backend>(f: &mut Frame<B>, area: Rect) {
15−/// let block = Block::default().title("Block").borders(Borders::ALL);
16−/// f.render_widget(Clear, area); // <- this will clear/reset the area first
17−/// f.render_widget(block, area); // now render the block widget
18−/// }
19−/// ```
20−///
21−/// # Popup Example
22−///
23−/// For a more complete example how to utilize `Clear` to realize popups see
24−/// the example `examples/popup.rs`
25−#[derive(Debug, Clone)]
26−pub struct Clear;
27−
28−impl Widget for Clear {
29− fn render(self, area: Rect, buf: &mut Buffer) {
30− for x in area.left()..area.right() {
31− for y in area.top()..area.bottom() {
32− buf.get_mut(x, y).reset();
33− }
34− }
35− }
36−}