mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-24 01:46:31 +00:00
fc5060a8e0
- Remove the inline feature detection, it doesn't work for features of dependencies. Instead use `required-features` in `Cargo.toml` for the specific binary. - The asset moved one level up relatively to `../../assets/style.toml`
23 lines
593 B
Rust
23 lines
593 B
Rust
use cursive::views::{Dialog, TextView};
|
|
|
|
fn main() {
|
|
let mut siv = cursive::default();
|
|
|
|
// You can load a theme from a file at runtime for fast development.
|
|
siv.load_theme_file("assets/style.toml").unwrap();
|
|
|
|
// Or you can directly load it from a string for easy deployment.
|
|
siv.load_toml(include_str!("../../assets/style.toml")).unwrap();
|
|
|
|
siv.add_layer(
|
|
Dialog::around(TextView::new(
|
|
"This application uses a \
|
|
custom theme!",
|
|
))
|
|
.title("Themed dialog")
|
|
.button("Quit", |s| s.quit()),
|
|
);
|
|
|
|
siv.run();
|
|
}
|