pub fn update_widget(&mut self, entity: Entity, force: bool, should_mark_as_dirty: bool) {
        self.current_node = entity;
        if !self.has::<Selector>("selector") {
            return;
        }

        if force {
            // direct access to prevent initial setting of dirty flag on widget
            self.ecm
                .component_store_mut()
                .get_mut::<Selector>("selector", self.current_node)
                .unwrap()
                .set_dirty(true);
        }

        let selector = self.clone::<Selector>("selector");

        if !selector.dirty() {
            return;
        }

        if let Some(props) = &mut self.theme.properties(&selector) {
            for (key, value) in props.drain() {
                match key.as_str() {
                    // special mapping
                    "padding_left" | "padding_top" | "padding_right" | "padding_bottom" => {
                        self.update_padding(&key, Value(value));
                    }
                    "width" | "height" | "min_width" | "min_height" | "max_width"
                    | "max_height" => self.update_constraint(&key, Value(value)),
                    _ => {
                        // common mapping
                        if self.is::<Brush>(&key) {
                            self.update_value::<Brush, Value>(&key, Value(value));
                        } else if self.is::<f32>(&key) {
                            self.update_value::<f32, Value>(&key, Value(value));
                        } else if self.is::<f64>(&key) {
                            self.update_value::<f64, Value>(&key, Value(value));
                        } else if self.is::<Thickness>(&key) {
                            self.update_value::<Thickness, Value>(&key, Value(value));
                        } else if self.is::<String>(&key) {
                            self.update_value::<String, Value>(&key, Value(value));
                        } else if self.is::<Alignment>(&key) {
                            self.update_value::<Alignment, Value>(&key, Value(value));
                        }
                    }
                }
            }
        }

        let force = selector.dirty() || force;

        for child in &(self.ecm.entity_store().children.clone())[&entity] {
            self.update_widget(*child, force, should_mark_as_dirty);
        }

        self.current_node = entity;

        // direct access to prevent initial setting of dirty flag on widget
        self.ecm
            .component_store_mut()
            .get_mut::<Selector>("selector", self.current_node)
            .unwrap()
            .set_dirty(false);

        if should_mark_as_dirty {
            mark_as_dirty("selector", self.current_node, self.ecm);
        }
    }
/// Update all properties from theme for the given widget.
Update all properties from theme for the given widget.
Update all properties from theme for the given widget .
pub fn update_widget(&mut self, entity: Entity, force: bool, should_mark_as_dirty: bool) {
        self.current_node = entity;
        if !self.has::<Selector>("selector") {
            return;
        }
        if force {
            // direct access to prevent initial setting of dirty flag on widget
            self.ecm
                .component_store_mut()
                .get_mut::<Selector>("selector", self.current_node)
                .unwrap()
                .set_dirty(true);
        }
        let selector = self.clone::<Selector>("selector");
        if !selector.dirty() {
            return;
        }
        if let Some(props) = &mut self.theme.properties(&selector) {
            for (key, value) in props.drain() {
                match key.as_str() {
                    // special mapping
                    "padding_left" | "padding_top" | "padding_right" | "padding_bottom" => {
                        self.update_padding(&key, Value(value));
                    }
                    "width" | "height" | "min_width" | "min_height" | "max_width"
                    | "max_height" => self.update_constraint(&key, Value(value)),
                    _ => {
                        // common mapping
                        if self.is::<Brush>(&key) {
                            self.update_value::<Brush, Value>(&key, Value(value));
                        } else if self.is::<f32>(&key) {
                            self.update_value::<f32, Value>(&key, Value(value));
                        } else if self.is::<f64>(&key) {
                            self.update_value::<f64, Value>(&key, Value(value));
                        } else if self.is::<Thickness>(&key) {
                            self.update_value::<Thickness, Value>(&key, Value(value));
                        } else if self.is::<String>(&key) {
                            self.update_value::<String, Value>(&key, Value(value));
                        } else if self.is::<Alignment>(&key) {
                            self.update_value::<Alignment, Value>(&key, Value(value));
                        }
                    }
                }
            }
        }
        let force = selector.dirty() || force;
        for child in &(self.ecm.entity_store().children.clone())[&entity] {
            self.update_widget(*child, force, should_mark_as_dirty);
        }
        self.current_node = entity;
        // direct access to prevent initial setting of dirty flag on widget
        self.ecm
            .component_store_mut()
            .get_mut::<Selector>("selector", self.current_node)
            .unwrap()
            .set_dirty(false);
        if should_mark_as_dirty {
            mark_as_dirty("selector", self.current_node, self.ecm);
        }
    }
pub fn update_widget ( & mut self , entity : Entity , force : bool , should_mark_as_dirty : bool ) { self . current_node = entity ; if ! self . has :: < Selector > ( " " ) { return ; } if force { // direct access to prevent initial setting of dirty flag on widget self . ecm . component_store_mut ( ) . get_mut :: < Selector > ( " " , self . current_node ) . unwrap ( ) . set_dirty ( true ) ; } let selector = self . clone :: < Selector > ( " " ) ; if ! selector . dirty ( ) { return ; } if let Some ( props ) = & mut self . theme . properties ( & selector ) { for ( key , value ) in props . drain ( ) { match key . as_str ( ) { // special mapping " " | " " | " " | " " => { self . update_padding ( & key , Value ( value ) ) ; } " " | " " | " " | " " | " " | " " => self . update_constraint ( & key , Value ( value ) ) , _ => { // common mapping if self . is :: < Brush > ( & key ) { self . update_value :: < Brush , Value > ( & key , Value ( value ) ) ; } else if self . is :: < f32 > ( & key ) { self . update_value :: < f32 , Value > ( & key , Value ( value ) ) ; } else if self . is :: < f64 > ( & key ) { self . update_value :: < f64 , Value > ( & key , Value ( value ) ) ; } else if self . is :: < Thickness > ( & key ) { self . update_value :: < Thickness , Value > ( & key , Value ( value ) ) ; } else if self . is :: < String > ( & key ) { self . update_value :: < String , Value > ( & key , Value ( value ) ) ; } else if self . is :: < Alignment > ( & key ) { self . update_value :: < Alignment , Value > ( & key , Value ( value ) ) ; } } } } } let force = selector . dirty ( ) || force ; for child in & ( self . ecm . entity_store ( ) . children . clone ( ) ) [ & entity ] { self . update_widget ( * child , force , should_mark_as_dirty ) ; } self . current_node = entity ; // direct access to prevent initial setting of dirty flag on widget self . ecm . component_store_mut ( ) . get_mut :: < Selector > ( " " , self . current_node ) . unwrap ( ) . set_dirty ( false ) ; if should_mark_as_dirty { mark_as_dirty ( " " , self . current_node , self . ecm ) ; } }
Update all properties from theme for the given widget.
Update all properties from theme for the given widget .
&mut self
entity
Entity
force
bool
should_mark_as_dirty
bool