refactor(tooltip): add extra message parameter to tooltips

This commit is contained in:
Ashley Wulber 2025-03-05 15:45:44 -05:00
parent be97a14dd7
commit 5b4ad7c18b
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
3 changed files with 38 additions and 34 deletions

View file

@ -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
})
}
}