refactor(tooltip): add extra message parameter to tooltips
This commit is contained in:
parent
be97a14dd7
commit
5b4ad7c18b
3 changed files with 38 additions and 34 deletions
|
|
@ -117,10 +117,9 @@ impl cosmic::Application for Window {
|
|||
}
|
||||
|
||||
Message::Surface(a) => {
|
||||
dbg!("hi i got an action...");
|
||||
return cosmic::task::message(cosmic::Action::Cosmic(cosmic::app::Action::Surface(
|
||||
a,
|
||||
)));
|
||||
return cosmic::task::message(cosmic::Action::Cosmic(
|
||||
cosmic::app::Action::Surface(a),
|
||||
));
|
||||
}
|
||||
Message::Selected(i) => {
|
||||
self.selected = Some(i);
|
||||
|
|
@ -195,11 +194,12 @@ impl cosmic::Application for Window {
|
|||
},
|
||||
);
|
||||
|
||||
Element::from(
|
||||
self.core
|
||||
.applet
|
||||
.applet_tooltip(btn, "test", self.popup.is_some(), |a| Message::Surface(a)),
|
||||
)
|
||||
Element::from(self.core.applet.applet_tooltip::<Message>(
|
||||
btn,
|
||||
"test",
|
||||
self.popup.is_some(),
|
||||
|a| Message::Surface(a),
|
||||
))
|
||||
}
|
||||
|
||||
fn view_window(&self, _id: Id) -> Element<Message> {
|
||||
|
|
@ -209,13 +209,4 @@ impl cosmic::Application for Window {
|
|||
fn style(&self) -> Option<cosmic::iced_runtime::Appearance> {
|
||||
Some(cosmic::applet::style())
|
||||
}
|
||||
|
||||
fn subscription(&self) -> cosmic::iced::Subscription<Message> {
|
||||
listen_with(|e, status, id| {
|
||||
if matches!(e, iced::event::Event::Keyboard(_)) {
|
||||
dbg!(e, id);
|
||||
}
|
||||
None
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue