fix reactivity 😭 + visual widget counter
This commit is contained in:
@@ -79,6 +79,7 @@ impl<W> Drop for WidgetId<W> {
|
||||
}
|
||||
|
||||
pub struct IdTag;
|
||||
pub struct IdFnTag;
|
||||
|
||||
// pub trait WidgetIdFn<W, Ctx> = FnOnce(&mut Ui<Ctx>) -> WidgetId<W>;
|
||||
macro_rules! WidgetIdFnRet {
|
||||
@@ -126,14 +127,14 @@ impl<F: FnOnce(&mut Ui<Ctx>) -> W, W: Widget<Ctx>, Ctx> Idable<Ctx, FnTag> for F
|
||||
}
|
||||
}
|
||||
|
||||
impl<W: 'static, Ctx> WidgetLike<Ctx, FnTag> for WidgetId<W> {
|
||||
impl<W: 'static, Ctx> WidgetLike<Ctx, IdTag> for WidgetId<W> {
|
||||
type Widget = W;
|
||||
fn add(self, _: &mut Ui<Ctx>) -> WidgetId<W> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl<W: 'static, F: FnOnce(&mut Ui<Ctx>) -> WidgetId<W>, Ctx> WidgetLike<Ctx, IdTag> for F {
|
||||
impl<W: 'static, F: FnOnce(&mut Ui<Ctx>) -> WidgetId<W>, Ctx> WidgetLike<Ctx, IdFnTag> for F {
|
||||
type Widget = W;
|
||||
fn add(self, ui: &mut Ui<Ctx>) -> WidgetId<W> {
|
||||
self(ui)
|
||||
|
||||
Reference in New Issue
Block a user