refactor(surface): type surface actions on the message they carry

This commit is contained in:
Hojjat 2026-09-08 13:04:15 -06:00 • committed by Michael Murphy
parent 376f1b8850
commit a8fe59f388
21 changed files with 194 additions and 181 deletions

View file

@ -28,7 +28,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
pub enum Message {
Clicked,
WindowClose,
Surface(cosmic::surface::Action),
Surface(cosmic::surface::Action<Message>),
ToggleHideContent,
ToggleSomeAction,
WindowNew,
@ -89,9 +89,7 @@ impl cosmic::Application for App {
self.button_label = format!("Clicked {message:?}");
}
Message::Surface(action) => {
return cosmic::task::message(cosmic::Action::Cosmic(
cosmic::app::Action::Surface(action),
));
return cosmic::task::message(cosmic::Action::Surface(action));
}
Message::WindowClose
| Message::ToggleHideContent