macro_rules! modifier {
(
$(#[$meta:meta])*
$name:ident, $t:ty, $flags:expr
) => {
$(#[$meta])*
#[allow(unused_variables)]
fn $name<U: Into<$t>>(mut self, value: impl Res<U>) -> Self {
let entity = self.entity();
let current = self.current();
value.set_or_bind(self.context(), move |cx, v| {
cx.style.$name.insert(entity, v.get_value(cx).into());
cx.style.system_flags |= $flags;
cx.set_system_flags(entity, $flags);
});
self
}
};
}
mod internal {
use crate::prelude::{Context, Entity, Handle};
pub trait Modifiable: Sized {
fn context(&mut self) -> &mut Context;
fn entity(&self) -> Entity;
fn current(&self) -> Entity;
}
impl<V> Modifiable for Handle<'_, V> {
fn context(&mut self) -> &mut Context {
self.cx
}
fn entity(&self) -> Entity {
self.entity
}
fn current(&self) -> Entity {
self.current
}
}
}
mod accessibility;
pub use accessibility::*;
mod actions;
pub use actions::*;
mod layout;
pub use layout::*;
mod style;
pub use style::*;
mod text;
pub use text::*;
mod abilities;
pub use abilities::*;
mod control;
pub use control::*;