feat(app): add context view method for creating About views

This commit is contained in:
Eduardo Flores 2024-11-06 02:36:33 +00:00 committed by GitHub
parent a4c1909fc2
commit 8d4afb90da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 413 additions and 0 deletions

View file

@ -78,6 +78,9 @@ pub enum Message {
/// Tracks updates to window suggested size.
#[cfg(feature = "applet")]
SuggestedBounds(Option<iced::Size>),
#[cfg(feature = "desktop")]
/// Opens the provided URL.
OpenUrl(String),
}
#[derive(Default)]
@ -661,6 +664,11 @@ impl<T: Application> Cosmic<T> {
let core = self.app.core_mut();
core.applet.suggested_bounds = b;
}
#[cfg(feature = "desktop")]
Message::OpenUrl(url) => match open::that_detached(url) {
Ok(_) => (),
Err(err) => tracing::error!("{err}"),
},
_ => {}
}