From 62350daba5641fb4a7b3675e5b0e0c6de912aad0 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Mon, 27 Jul 2020 17:31:38 -0400 Subject: [PATCH] majc: implement changelog screen --- majc/src/changelog.gmi | 8 ++++++++ majc/src/commands.rs | 10 ++++++++++ majc/src/main.rs | 1 + 3 files changed, 19 insertions(+) create mode 100644 majc/src/changelog.gmi diff --git a/majc/src/changelog.gmi b/majc/src/changelog.gmi new file mode 100644 index 0000000..0315c03 --- /dev/null +++ b/majc/src/changelog.gmi @@ -0,0 +1,8 @@ +## 0.2.0 + +* History works (h/l) +* Added changelog screen + +## 0.1.0 + +* Base functionality implemented diff --git a/majc/src/commands.rs b/majc/src/commands.rs index a3752f2..9366fe6 100644 --- a/majc/src/commands.rs +++ b/majc/src/commands.rs @@ -14,6 +14,16 @@ pub fn help(siv: &mut Cursive) { ); } +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", diff --git a/majc/src/main.rs b/majc/src/main.rs index ded7bce..b3bd9d2 100644 --- a/majc/src/main.rs +++ b/majc/src/main.rs @@ -28,6 +28,7 @@ fn main() { "majc", MenuTree::new() .leaf("About", commands::about) + .leaf("Changelog", commands::changelog) .leaf("Help", commands::help) .leaf("Quit", cursive::Cursive::quit), )