Make widget example look slightly less horrible

This commit is contained in:
Joscha 2023-02-16 21:32:47 +01:00
parent c689d97974
commit 845d88c93f

View file

@ -6,7 +6,7 @@ use toss::widgets::{BorderLook, Text};
use toss::{Style, Styled, Terminal, Widget, WidgetExt}; use toss::{Style, Styled, Terminal, Widget, WidgetExt};
fn widget() -> impl Widget<Infallible> { fn widget() -> impl Widget<Infallible> {
let styled = Styled::new("Hello world!", Style::new().green()) let styled = Styled::new("Hello world!", Style::new().dark_green())
.then_plain("\n") .then_plain("\n")
.then("Press any key to exit", Style::new().on_dark_blue()); .then("Press any key to exit", Style::new().on_dark_blue());
Text::new(styled) Text::new(styled)
@ -16,7 +16,7 @@ fn widget() -> impl Widget<Infallible> {
.look(BorderLook::LINE_DOUBLE) .look(BorderLook::LINE_DOUBLE)
.style(Style::new().dark_red()) .style(Style::new().dark_red())
.background() .background()
.style(Style::new().on_dark_yellow().opaque()) .style(Style::new().on_yellow().opaque())
.float() .float()
.all(0.5) .all(0.5)
} }