work
This commit is contained in:
1 parent
a9c76e4326
commit
79813db3ba
35 files changed
+378
-403
No files matched your search
@@ -1,4 +1,4 @@
|
||||
use crate::{HasEvents, HasUi, Widget, WidgetRef};
|
||||
use crate::{HasEvents, WeakWidget, Widget};
|
||||
|
||||
pub struct EventCtx<'a, Rsc: HasEvents, Data> {
|
||||
pub state: &'a mut Rsc::State,
|
||||
@@ -6,13 +6,13 @@ pub struct EventCtx<'a, Rsc: HasEvents, Data> {
|
||||
}
|
||||
|
||||
pub struct EventIdCtx<'a, Rsc: HasEvents, Data, W: ?Sized> {
|
||||
pub widget: WidgetRef<W>,
|
||||
pub widget: WeakWidget<W>,
|
||||
pub state: &'a mut Rsc::State,
|
||||
pub data: Data,
|
||||
}
|
||||
|
||||
impl<Rsc: HasEvents + HasUi, Data, W: Widget> EventIdCtx<'_, Rsc, Data, W> {
|
||||
impl<Rsc: HasEvents, Data, W: Widget> EventIdCtx<'_, Rsc, Data, W> {
|
||||
pub fn widget<'a>(&self, rsc: &'a mut Rsc) -> &'a mut W {
|
||||
&mut rsc.ui_mut()[self.widget]
|
||||
&mut rsc.widgets_mut()[self.widget]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user