mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
wip: big flat pt.9: down to 141, looking good!
This commit is contained in:
parent
e958b4a2d2
commit
d01aa7481b
7 changed files with 39 additions and 12 deletions
14
src/style.rs
14
src/style.rs
|
|
@ -1,23 +1,25 @@
|
|||
use crate::*;
|
||||
|
||||
impl Tui {
|
||||
pub(crate) fn fg <W: Render<Tui>> (color: Color, w: W) -> Foreground<W> {
|
||||
pub trait TuiStyle {
|
||||
fn fg <W: Render<Tui>> (color: Color, w: W) -> Foreground<W> {
|
||||
Foreground(color, w)
|
||||
}
|
||||
pub(crate) fn bg <W: Render<Tui>> (color: Color, w: W) -> Background<W> {
|
||||
fn bg <W: Render<Tui>> (color: Color, w: W) -> Background<W> {
|
||||
Background(color, w)
|
||||
}
|
||||
pub(crate) fn fg_bg <W: Render<Tui>> (fg: Color, bg: Color, w: W) -> Background<Foreground<W>> {
|
||||
fn fg_bg <W: Render<Tui>> (fg: Color, bg: Color, w: W) -> Background<Foreground<W>> {
|
||||
Background(bg, Foreground(fg, w))
|
||||
}
|
||||
pub(crate) fn bold <W: Render<Tui>> (on: bool, w: W) -> Bold<W> {
|
||||
fn bold <W: Render<Tui>> (on: bool, w: W) -> Bold<W> {
|
||||
Bold(on, w)
|
||||
}
|
||||
pub(crate) fn border <W: Render<Tui>, S: BorderStyle> (style: S, w: W) -> Bordered<S, W> {
|
||||
fn border <W: Render<Tui>, S: BorderStyle> (style: S, w: W) -> Bordered<S, W> {
|
||||
Bordered(style, w)
|
||||
}
|
||||
}
|
||||
|
||||
impl TuiStyle for Tui {}
|
||||
|
||||
pub struct Bold<W: Render<Tui>>(pub bool, W);
|
||||
|
||||
impl<W: Render<Tui>> Render<Tui> for Bold<W> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue