diff options
author | 2023-10-27 05:04:14 +0200 | |
---|---|---|
committer | 2023-10-27 05:04:14 +0200 | |
commit | 625cd745f38215b1cb8f629cdc6d2fa41c9a739a (patch) | |
tree | af96038ba4800937b3b3c7c0383cd47776bbb69c /examples/editor | |
parent | 65823875791ecebf24d049cc0782e7475a37899b (diff) | |
download | iced-625cd745f38215b1cb8f629cdc6d2fa41c9a739a.tar.gz iced-625cd745f38215b1cb8f629cdc6d2fa41c9a739a.tar.bz2 iced-625cd745f38215b1cb8f629cdc6d2fa41c9a739a.zip |
Write documentation for the new text APIs
Diffstat (limited to 'examples/editor')
-rw-r--r-- | examples/editor/src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/editor/src/main.rs b/examples/editor/src/main.rs index a69e1f54..03d1e283 100644 --- a/examples/editor/src/main.rs +++ b/examples/editor/src/main.rs @@ -34,7 +34,7 @@ struct Editor { #[derive(Debug, Clone)] enum Message { - Edit(text_editor::Action), + ActionPerformed(text_editor::Action), ThemeSelected(highlighter::Theme), NewFile, OpenFile, @@ -68,10 +68,10 @@ impl Application for Editor { fn update(&mut self, message: Message) -> Command<Message> { match message { - Message::Edit(action) => { + Message::ActionPerformed(action) => { self.is_dirty = self.is_dirty || action.is_edit(); - self.content.edit(action); + self.content.perform(action); Command::none() } @@ -103,7 +103,7 @@ impl Application for Editor { if let Ok((path, contents)) = result { self.file = Some(path); - self.content = text_editor::Content::with(&contents); + self.content = text_editor::Content::with_text(&contents); } Command::none() @@ -191,7 +191,7 @@ impl Application for Editor { column![ controls, text_editor(&self.content) - .on_edit(Message::Edit) + .on_action(Message::ActionPerformed) .highlight::<Highlighter>( highlighter::Settings { theme: self.theme, |