feat: add subscription method for Page trait
This commit is contained in:
parent
e810acd8f1
commit
6701a634b7
4 changed files with 49 additions and 20 deletions
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue