abuse macros..

This commit is contained in:
2025-12-20 00:26:08 -05:00
parent bae17235c6
commit fabc7d0b90
12 changed files with 125 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
use crate::{HasUi, WidgetIdFn, WidgetLike, WidgetRef};
use crate::{HasUi, StateLike, WidgetIdFn, WidgetLike, WidgetRef};
pub trait WidgetAttr<State, W: ?Sized> {
type Input;
@@ -9,7 +9,9 @@ pub trait Attrable<State, W: ?Sized, Tag> {
fn attr<A: WidgetAttr<State, W>>(self, input: A::Input) -> impl WidgetIdFn<State, W>;
}
impl<State: HasUi, WL: WidgetLike<State, Tag>, Tag> Attrable<State, WL::Widget, Tag> for WL {
impl<State: HasUi + StateLike<State>, WL: WidgetLike<State, Tag>, Tag>
Attrable<State, WL::Widget, Tag> for WL
{
fn attr<A: WidgetAttr<State, WL::Widget>>(
self,
input: A::Input,