NotesEditor stories: the old five-paragraph speaker notes as Default

This commit is contained in:
aiongg
2026-11-12 14:32:49 +00:00
parent d27244eac7
commit 24ea1e849e
+20 -1
View File
@@ -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()
}