You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In widget macros, implement mapping a property value to another property in the same widget using the expr_var syntax.
#[widget($crate::foo)]pubmod foo {properties!{
a_property;
/// This property is set only when `a_property` has a value and it is a mapping of the a_property.
b_property = 1 + #a_property + 3;
/// This property is set only when `a_property` is and it is a mapping of the a_property.
on_prop = hn!(#a_property, |_| {
println!(a_property.get());
});
}}
How does this integrate with when?
Not allowed in when assigns?
In the example above a_property is affected by when in the handler.
Use cases:
Border color depend on background color with when only assigning background.
The text was updated successfully, but these errors were encountered:
In widget macros, implement mapping a property value to another property in the same widget using the
expr_var
syntax.when
?a_property
is affected bywhen
in the handler.when
only assigning background.The text was updated successfully, but these errors were encountered: