mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 16:53:05 +00:00
NotesEditor stories: the old five-paragraph speaker notes as Default
This commit is contained in:
@@ -7,6 +7,19 @@ use egui::Ui;
|
||||
use super::{NotesEditor, NotesParagraph, NotesRun, NotesText};
|
||||
use crate::lists::ListMarker;
|
||||
|
||||
/// Speaker notes: an opening paragraph, a key message with a bold lead, two bullets one level in, and a closing line.
|
||||
fn speaker_notes() -> NotesText {
|
||||
let plain = |text: &str| NotesRun::new(text);
|
||||
let item = |text: &str| NotesParagraph::new(vec![plain(text)]).list(1, Some(ListMarker::Bullet("•".into())));
|
||||
NotesText::new(vec![
|
||||
NotesParagraph::new(vec![plain("Welcome everyone and introduce the agenda for the next thirty minutes before taking questions.")]),
|
||||
NotesParagraph::new(vec![plain("Key message:").bold(true), plain(" revenue grew in every region, led by the new subscription tier.")]),
|
||||
item("Show the regional chart"),
|
||||
item("Pause for questions on pricing"),
|
||||
NotesParagraph::new(vec![plain("Thank the team and hand over to the next speaker.")]),
|
||||
])
|
||||
}
|
||||
|
||||
fn bullets() -> NotesText {
|
||||
let run = |text: &str, bold: bool| NotesRun::new(text).bold(bold);
|
||||
let bullet = || Some(ListMarker::Bullet("•".into()));
|
||||
@@ -17,6 +30,12 @@ fn bullets() -> NotesText {
|
||||
}
|
||||
|
||||
#[story(NotesEditor<'static>, covers = [Default], drive = Drive::Never)]
|
||||
fn editing_speaker_notes(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let notes = data.value("notes", speaker_notes());
|
||||
NotesEditor::new("Notes", notes).show(ui).response.into()
|
||||
}
|
||||
|
||||
#[story(NotesEditor<'static>, covers = [], drive = Drive::Never)]
|
||||
fn editing_bullets(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let notes = data.value("notes", bullets());
|
||||
NotesEditor::new("Notes", notes).show(ui).response.into()
|
||||
@@ -30,6 +49,6 @@ fn long_text(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
|
||||
#[story(NotesEditor<'static>, covers = [], drive = Drive::Never)]
|
||||
fn read_only(ui: &mut Ui, data: &mut StoryData) -> StoryOutput {
|
||||
let notes = data.value("notes", bullets());
|
||||
let notes = data.value("notes", speaker_notes());
|
||||
NotesEditor::new("Notes", notes).read_only(true).show(ui).response.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user