cursive/examples/theme_manual.rs
Alexandre Bury f7a3d821d1 Actually use Theme::{shadow,borders} when drawing
Also add the 8 light base colors
2016-08-04 17:27:04 -07:00

26 lines
847 B
Rust

extern crate cursive;
use cursive::prelude::*;
use cursive::theme::BorderStyle;
fn main() {
let mut siv = Cursive::new();
siv.add_layer(Dialog::text("This is a dynamic theme example!")
.button("Change", |s| {
let mut theme = s.current_theme().clone();
theme.shadow = !theme.shadow;
theme.borders = match theme.borders {
Some(BorderStyle::Simple) => Some(BorderStyle::Outset),
Some(BorderStyle::Outset) => None,
None => Some(BorderStyle::Simple),
};
s.set_theme(theme);
})
.button("Quit", Cursive::quit));
siv.run();
}