diff --git a/src/main.rs b/src/main.rs index 891bb47..792773b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,12 +45,15 @@ enum Message { new_value: String, }, + EditNotes(widget::text_editor::Action), + Event(iced::Event), } #[derive(Clone, Debug, Default)] struct State { table: data::Table, + content: widget::text_editor::Content, } impl State { fn new() -> Self { @@ -144,6 +147,7 @@ impl State { .padding(15) .into(), ]) + .push(widget::text_editor(&self.content).on_action(Message::EditNotes)) .align_x(Horizontal::Center) .into() } @@ -189,6 +193,10 @@ impl State { self.table[i_category].elements[i_element] = new_value; } + Message::EditNotes(action) => { + self.content.perform(action); + } + Message::Event(iced::Event::Keyboard(keyboard::Event::KeyPressed { key, modifiers,