diff options
| author | Vladislav Stepanov <8uk.8ak@gmail.com> | 2023-04-14 23:18:58 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 20:18:58 +0100 |
| commit | c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d (patch) | |
| tree | 2c44a44eda7e76fa74e78ac1fd02f55c1ed4d804 /src/ratatui/widgets/clear.rs | |
| parent | Switch to uuidv7 (#864) (diff) | |
| download | atuin-c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d.zip | |
Workspace reorder (#868)
* Try different workspace structure
Move main crate (atuin) to be on the same level with other crates in
this workspace
* extract common dependencies to the workspace definition
* fix base64 v0.21 deprecation warning
* questionable: update deps & fix chrono deprecations
possible panic sites are unchanged, they're just more visible now
* Revert "questionable: update deps & fix chrono deprecations"
This reverts commit 993e60f8dea81a1625a04285a617959ad09a0866.
Diffstat (limited to 'src/ratatui/widgets/clear.rs')
| -rw-r--r-- | src/ratatui/widgets/clear.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/ratatui/widgets/clear.rs b/src/ratatui/widgets/clear.rs deleted file mode 100644 index a7c8d34b..00000000 --- a/src/ratatui/widgets/clear.rs +++ /dev/null @@ -1,37 +0,0 @@ -use crate::ratatui::{buffer::Buffer, layout::Rect, widgets::Widget}; - -/// A widget to clear/reset a certain area to allow overdrawing (e.g. for popups). -/// -/// This widget **cannot be used to clear the terminal on the first render** as `ratatui` assumes the -/// render area is empty. Use [`crate::Terminal::clear`] instead. -/// -/// # Examples -/// -/// ``` -/// # use ratatui::widgets::{Clear, Block, Borders}; -/// # use ratatui::layout::Rect; -/// # use ratatui::Frame; -/// # use ratatui::backend::Backend; -/// fn draw_on_clear<B: Backend>(f: &mut Frame<B>, area: Rect) { -/// let block = Block::default().title("Block").borders(Borders::ALL); -/// f.render_widget(Clear, area); // <- this will clear/reset the area first -/// f.render_widget(block, area); // now render the block widget -/// } -/// ``` -/// -/// # Popup Example -/// -/// For a more complete example how to utilize `Clear` to realize popups see -/// the example `examples/popup.rs` -#[derive(Debug, Clone)] -pub struct Clear; - -impl Widget for Clear { - fn render(self, area: Rect, buf: &mut Buffer) { - for x in area.left()..area.right() { - for y in area.top()..area.bottom() { - buf.get_mut(x, y).reset(); - } - } - } -} |
