improv: impl From<M> for Message<M>
This commit is contained in:
parent
f4936344f0
commit
aa3f5d3401
3 changed files with 8 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -37,6 +37,12 @@ pub mod message {
|
|||
pub const fn none<M>() -> Message<M> {
|
||||
Message::None
|
||||
}
|
||||
|
||||
impl<M> From<M> for Message<M> {
|
||||
fn from(value: M) -> Self {
|
||||
Self::App(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub use self::command::Command;
|
||||
|
|
|
|||
|
|
@ -372,7 +372,7 @@ pub fn style() -> <crate::Theme as iced_style::application::StyleSheet>::Style {
|
|||
pub fn menu_button<'a, Message>(
|
||||
content: impl Into<Element<'a, Message>>,
|
||||
) -> crate::widget::Button<'a, Message> {
|
||||
crate::widget::Button::new(content)
|
||||
crate::widget::button(content)
|
||||
.style(Button::AppletMenu)
|
||||
.padding(menu_control_padding())
|
||||
.width(Length::Fill)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue