rename widget fn macros
This commit is contained in:
@@ -120,7 +120,7 @@ pub struct IdTag;
|
||||
pub struct IdFnTag;
|
||||
|
||||
// pub trait WidgetIdFn<W, Ctx> = FnOnce(&mut Ui) -> WidgetId<W>;
|
||||
macro_rules! WidgetIdFnRet {
|
||||
macro_rules! WidgetIdFn {
|
||||
($W:ty) => {
|
||||
impl FnOnce(&mut $crate::layout::Ui) -> $crate::layout::WidgetId<$W>
|
||||
};
|
||||
@@ -128,15 +128,12 @@ macro_rules! WidgetIdFnRet {
|
||||
impl FnOnce(&mut $crate::layout::Ui) -> $crate::layout::WidgetId<$W> + use<$($use)*>
|
||||
};
|
||||
}
|
||||
pub(crate) use WidgetIdFnRet;
|
||||
pub(crate) use WidgetIdFn;
|
||||
|
||||
pub trait Idable<Tag> {
|
||||
type Widget: Widget;
|
||||
fn set(self, ui: &mut Ui, id: &WidgetId<Self::Widget>);
|
||||
fn id<'a>(
|
||||
self,
|
||||
id: &WidgetId<Self::Widget>,
|
||||
) -> WidgetIdFnRet!(Self::Widget, 'a, Self, Tag)
|
||||
fn id<'a>(self, id: &WidgetId<Self::Widget>) -> WidgetIdFn!(Self::Widget, 'a, Self, Tag)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
@@ -149,7 +146,7 @@ pub trait Idable<Tag> {
|
||||
fn id_static<'a>(
|
||||
self,
|
||||
id: StaticWidgetId<Self::Widget>,
|
||||
) -> WidgetIdFnRet!(Self::Widget, 'a, Self, Tag)
|
||||
) -> WidgetIdFn!(Self::Widget, 'a, Self, Tag)
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user