feat: add subscription method for Page trait

This commit is contained in:
Michael Aaron Murphy 2025-06-04 07:51:41 +02:00
parent e810acd8f1
commit 6701a634b7
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
4 changed files with 49 additions and 20 deletions

View file

@ -5,7 +5,7 @@ mod binder;
pub use binder::{AutoBind, Binder};
mod insert;
use cosmic::{Element, Task, app::ContextDrawer};
use cosmic::{Element, Task, app::ContextDrawer, iced::Subscription};
use downcast_rs::{Downcast, impl_downcast};
pub use insert::Insert;
@ -89,6 +89,12 @@ pub trait Page<Message: Clone + 'static>: Downcast {
Task::none()
}
/// Subscription unique to the page when it is active.
#[inline]
fn subscription(&self, _core: &cosmic::Core) -> Subscription<Message> {
Subscription::none()
}
/// Assigns the entity ID of the page to the page.
#[allow(unused)]
#[inline]