maj/majc/src/commands.rs

35 lines
870 B
Rust
Raw Normal View History

use cursive::{
traits::*,
views::{Dialog, TextView},
Cursive,
};
pub fn help(siv: &mut Cursive) {
let content = include_str!("./help.gmi");
siv.add_layer(
Dialog::around(TextView::new(crate::gemini::render(content)).scrollable())
.title("Help")
.dismiss_button("Ok"),
);
}
2020-07-27 21:31:38 +00:00
pub fn changelog(siv: &mut Cursive) {
let content = include_str!("./changelog.gmi");
siv.add_layer(
Dialog::around(TextView::new(crate::gemini::render(content)).scrollable())
.title("Changelog")
.dismiss_button("Ok"),
);
}
pub fn about(siv: &mut Cursive) {
siv.add_layer(Dialog::info(format!(
"{} {}\n\nby {}\n\nSee https://tulpa.dev/cadey/maj for more information",
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION"),
env!("CARGO_PKG_AUTHORS"),
)));
}