fn update_visual(&self, ctx: &mut Context) {
        let selected: bool = *Switch::selected_ref(&ctx.widget());
        let mut switch_toggle = ctx.get_widget(self.switch_toggle);

        if selected {
            switch_toggle.set("h_align", Alignment::from("end"));
            switch_toggle
                .get_mut::<Selector>("selector")
                .push_state("selected");
        } else {
            switch_toggle.set("h_align", Alignment::from("start"));
            switch_toggle
                .get_mut::<Selector>("selector")
                .remove_state("selected");
        }

        switch_toggle.update(true);
    }
// update the visual state to the selection state.
update the visual state to the selection state.
update the visual state to the selection state .
fn update_visual(&self, ctx: &mut Context) {
        let selected: bool = *Switch::selected_ref(&ctx.widget());
        let mut switch_toggle = ctx.get_widget(self.switch_toggle);
        if selected {
            switch_toggle.set("h_align", Alignment::from("end"));
            switch_toggle
                .get_mut::<Selector>("selector")
                .push_state("selected");
        } else {
            switch_toggle.set("h_align", Alignment::from("start"));
            switch_toggle
                .get_mut::<Selector>("selector")
                .remove_state("selected");
        }
        switch_toggle.update(true);
    }
fn update_visual ( & self , ctx : & mut Context ) { let selected : bool = * Switch :: selected_ref ( & ctx . widget ( ) ) ; let mut switch_toggle = ctx . get_widget ( self . switch_toggle ) ; if selected { switch_toggle . set ( " " , Alignment :: from ( " " ) ) ; switch_toggle . get_mut :: < Selector > ( " " ) . push_state ( " " ) ; } else { switch_toggle . set ( " " , Alignment :: from ( " " ) ) ; switch_toggle . get_mut :: < Selector > ( " " ) . remove_state ( " " ) ; } switch_toggle . update ( true ) ; }
update the visual state to the selection state.
update the visual state to the selection state .
&self
ctx
&mut Context