Outline
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
use crate::widget::Widget;
|
||||
|
||||
pub struct Outline;
|
||||
|
||||
impl Widget for Outline {
|
||||
fn render(&self, scope: &mut crate::render::RenderScope) {
|
||||
scope.draw_text(0, "-".repeat(scope.rect.width as usize));
|
||||
|
||||
scope.draw_text((0, 1), "|\n".repeat(scope.rect.height as usize - 2));
|
||||
scope.draw_text(
|
||||
(scope.rect.width, 1),
|
||||
"|\n".repeat(scope.rect.height as usize - 2),
|
||||
);
|
||||
|
||||
scope.draw_text(
|
||||
(0, scope.rect.height),
|
||||
"-".repeat(scope.rect.width as usize),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user