fn close_selection(&mut self, ctx: &mut Context, p: Point) {
        let combo_box_position = ctx.widget().clone::<Point>("position");
        let combo_box_bounds = ctx.widget().clone::<Rectangle>("bounds");

        let combo_box_global_bounds = Rectangle::new(combo_box_position, combo_box_bounds.size());

        if !combo_box_global_bounds.contains(p) {
            ctx.widget().set("selected", false);
            ctx.widget()
                .get_mut::<Selector>("selector")
                .remove_state("selected");
            ctx.get_widget(self.popup)
                .set("visibility", Visibility::Collapsed);
            ctx.get_widget(self.popup).update(false);
            ctx.widget().update(false);
        }
    }
// closes the popup if `mouse up` is raised outside of the
// Combobox related bounds.
closes the popup if `mouse up` is raised outside of the
Combobox related bounds.
closes the popup if ` mouse up ` is raised outside of the Combobox related bounds .
fn close_selection(&mut self, ctx: &mut Context, p: Point) {
        let combo_box_position = ctx.widget().clone::<Point>("position");
        let combo_box_bounds = ctx.widget().clone::<Rectangle>("bounds");
        let combo_box_global_bounds = Rectangle::new(combo_box_position, combo_box_bounds.size());
        if !combo_box_global_bounds.contains(p) {
            ctx.widget().set("selected", false);
            ctx.widget()
                .get_mut::<Selector>("selector")
                .remove_state("selected");
            ctx.get_widget(self.popup)
                .set("visibility", Visibility::Collapsed);
            ctx.get_widget(self.popup).update(false);
            ctx.widget().update(false);
        }
    }
fn close_selection ( & mut self , ctx : & mut Context , p : Point ) { let combo_box_position = ctx . widget ( ) . clone :: < Point > ( " " ) ; let combo_box_bounds = ctx . widget ( ) . clone :: < Rectangle > ( " " ) ; let combo_box_global_bounds = Rectangle :: new ( combo_box_position , combo_box_bounds . size ( ) ) ; if ! combo_box_global_bounds . contains ( p ) { ctx . widget ( ) . set ( " " , false ) ; ctx . widget ( ) . get_mut :: < Selector > ( " " ) . remove_state ( " " ) ; ctx . get_widget ( self . popup ) . set ( " " , Visibility :: Collapsed ) ; ctx . get_widget ( self . popup ) . update ( false ) ; ctx . widget ( ) . update ( false ) ; } }
closes the popup if `mouse up` is raised outside of the
Combobox related bounds.
closes the popup if ` mouse up ` is raised outside of the Combobox related bounds .
&mut self
ctx
&mut Context
p
Point