diff --git a/examples/open-dialog/src/main.rs b/examples/open-dialog/src/main.rs index f8b95360..63bb3a10 100644 --- a/examples/open-dialog/src/main.rs +++ b/examples/open-dialog/src/main.rs @@ -140,7 +140,7 @@ impl cosmic::Application for App { // Send this back to the application. Message::FileRead(url, contents) }) - .map(cosmic::app::message::app); + .map(Into::into); } // Creates a new open dialog. diff --git a/src/app/mod.rs b/src/app/mod.rs index 3fbc7cc8..408a712b 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -37,6 +37,12 @@ pub mod message { pub const fn none() -> Message { Message::None } + + impl From for Message { + fn from(value: M) -> Self { + Self::App(value) + } + } } pub use self::command::Command; diff --git a/src/applet/mod.rs b/src/applet/mod.rs index 07a9c272..2c60cc62 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -372,7 +372,7 @@ pub fn style() -> ::Style { pub fn menu_button<'a, Message>( content: impl Into>, ) -> crate::widget::Button<'a, Message> { - crate::widget::Button::new(content) + crate::widget::button(content) .style(Button::AppletMenu) .padding(menu_control_padding()) .width(Length::Fill)