Commit e4f27932 authored by Florian Blasius's avatar Florian Blasius 🤘

[fix] constraint bug

parent 93458c0c
......@@ -84,8 +84,16 @@ macro_rules! widget {
}
/// Sets or shares the constraint property.
pub fn constraint<P: Into<PropertySource<Constraint>>>(self, constraint: P) -> Self {
self.attach(constraint)
pub fn constraint<P: Into<PropertySource<Constraint>>>(mut self, constraint: P) -> Self {
match constraint.into() {
PropertySource::Value(value) => {
self.constraint = value;
},
PropertySource::Source(source) => {
self.shared_attached_properties.insert(TypeId::of::<Constraint>(), SharedComponentBox::new(TypeId::of::<Constraint>(), source));
}
}
self
}
/// Sets or shares the vertical alignment property.
......
use crate::prelude::*;
/// The `ScrollMode` defines the mode of a scroll direction.
#[derive(Copy, Debug, Clone, PartialEq)]
pub enum ScrollMode {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment