mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
shorten TuiIn, TuiOut
This commit is contained in:
parent
ca16a91015
commit
21741ebc52
20 changed files with 77 additions and 75 deletions
|
|
@ -53,7 +53,7 @@ pub trait BorderStyle: Send + Sync + Copy {
|
|||
fn sw (&self) -> &str { Self::SW }
|
||||
fn se (&self) -> &str { Self::SE }
|
||||
#[inline] fn draw <'a> (
|
||||
&self, to: &mut TuiOutput
|
||||
&self, to: &mut TuiOut
|
||||
) -> Usually<()> {
|
||||
self.draw_horizontal(to, None)?;
|
||||
self.draw_vertical(to, None)?;
|
||||
|
|
@ -61,7 +61,7 @@ pub trait BorderStyle: Send + Sync + Copy {
|
|||
Ok(())
|
||||
}
|
||||
#[inline] fn draw_horizontal (
|
||||
&self, to: &mut TuiOutput, style: Option<Style>
|
||||
&self, to: &mut TuiOut, style: Option<Style>
|
||||
) -> Usually<[u16;4]> {
|
||||
let area = to.area();
|
||||
let style = style.or_else(||self.style_horizontal());
|
||||
|
|
@ -73,7 +73,7 @@ pub trait BorderStyle: Send + Sync + Copy {
|
|||
Ok(area)
|
||||
}
|
||||
#[inline] fn draw_vertical (
|
||||
&self, to: &mut TuiOutput, style: Option<Style>
|
||||
&self, to: &mut TuiOut, style: Option<Style>
|
||||
) -> Usually<[u16;4]> {
|
||||
let area = to.area();
|
||||
let style = style.or_else(||self.style_vertical());
|
||||
|
|
@ -91,7 +91,7 @@ pub trait BorderStyle: Send + Sync + Copy {
|
|||
Ok(area)
|
||||
}
|
||||
#[inline] fn draw_corners (
|
||||
&self, to: &mut TuiOutput, style: Option<Style>
|
||||
&self, to: &mut TuiOut, style: Option<Style>
|
||||
) -> Usually<[u16;4]> {
|
||||
let area = to.area();
|
||||
let style = style.or_else(||self.style_corners());
|
||||
|
|
@ -129,7 +129,7 @@ macro_rules! border {
|
|||
#[derive(Copy, Clone)]
|
||||
pub struct $T(pub Style);
|
||||
impl Content<Tui> for $T {
|
||||
fn render (&self, to: &mut TuiOutput) { self.draw(to); }
|
||||
fn render (&self, to: &mut TuiOut) { self.draw(to); }
|
||||
}
|
||||
)+}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue