diff --git a/examples/custom_widgets.rs b/examples/custom_widgets.rs index dd280fe..9a0cba4 100644 --- a/examples/custom_widgets.rs +++ b/examples/custom_widgets.rs @@ -22,7 +22,7 @@ fn main() -> iced::Result { #[derive(Debug, Clone)] pub enum Message { - BrowserWidget(widgets::Message), // Passes messagees to Browser widgets + IcyBrowser(widgets::Message), Update, Tick, } @@ -61,8 +61,8 @@ impl Default for Browser { impl Browser { fn update(&mut self, message: Message) -> Task { match message { - Message::BrowserWidget(msg) => self.icy_browser.update(msg).map(Message::BrowserWidget), - Message::Update => self.icy_browser.force_update().map(Message::BrowserWidget), + Message::IcyBrowser(msg) => self.icy_browser.update(msg).map(Message::IcyBrowser), + Message::Update => self.icy_browser.force_update().map(Message::IcyBrowser), Message::Tick => Task::none(), // Tick } } @@ -72,7 +72,7 @@ impl Browser { let color_index = (elapsed * 2.0) as usize % self.custom_widget_state.border_colors.len(); let color = self.custom_widget_state.border_colors[color_index]; - container(self.icy_browser.view().map(Message::BrowserWidget)) + container(self.icy_browser.view().map(Message::IcyBrowser)) .center_x(Length::Fill) .center_y(Length::Fill) .padding(20) diff --git a/examples/keyboard_driven.rs b/examples/keyboard_driven.rs index 9b948cc..c171250 100644 --- a/examples/keyboard_driven.rs +++ b/examples/keyboard_driven.rs @@ -6,8 +6,8 @@ use iced::{Element, Settings, Subscription, Task}; use std::time::Duration; use icy_browser::{ - get_fonts, widgets, Bookmark, IcyBrowser, KeyType, Message as WidgetMessage, ShortcutBuilder, - ShortcutModifier, Ultralight, + get_fonts, widgets, Bookmark, IcyBrowser, KeyType, ShortcutBuilder, ShortcutModifier, + Ultralight, }; fn main() -> iced::Result { @@ -27,7 +27,7 @@ fn main() -> iced::Result { #[derive(Debug, Clone)] pub enum Message { - BrowserWidget(widgets::Message), // Passes messagees to Browser widgets + IcyBrowser(icy_browser::Message), // Passes messages to icy_browser Update, Event(Event), } @@ -40,7 +40,7 @@ impl Default for Browser { fn default() -> Self { let shortcuts = ShortcutBuilder::new() .add_shortcut( - WidgetMessage::ToggleOverlay, + icy_browser::Message::ToggleOverlay, vec![ KeyType::Modifier(ShortcutModifier::Ctrl), KeyType::Key(iced::keyboard::Key::Character("e".into())), @@ -69,17 +69,17 @@ impl Default for Browser { impl Browser { fn update(&mut self, message: Message) -> Task { match message { - Message::BrowserWidget(msg) => self.icy_browser.update(msg).map(Message::BrowserWidget), - Message::Update => self.icy_browser.force_update().map(Message::BrowserWidget), + Message::IcyBrowser(msg) => self.icy_browser.update(msg).map(Message::IcyBrowser), + Message::Update => self.icy_browser.force_update().map(Message::IcyBrowser), Message::Event(event) => self .icy_browser .update(widgets::Message::IcedEvent(Some(event))) - .map(Message::BrowserWidget), + .map(Message::IcyBrowser), } } fn view(&self) -> Element { - self.icy_browser.view().map(Message::BrowserWidget) + self.icy_browser.view().map(Message::IcyBrowser) } fn subscription(&self) -> Subscription {