use cursive::{ traits::*, views::{Dialog, TextView}, Cursive, }; pub fn quit(siv: &mut Cursive) { siv.add_layer( Dialog::text("Are you sure you want to quit?") .button("No", |s| { s.pop_layer(); }) .button("Yes", Cursive::quit), ); } 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"), ); } 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"), ))); }