pub fn sort_windows(&mut self) {
        use crate::models::WindowType;
        //first dialogs and modals
        let (level1, other): (Vec<&Window>, Vec<&Window>) = self.windows.iter().partition(|w| {
            w.r#type == WindowType::Dialog
                || w.r#type == WindowType::Splash
                || w.r#type == WindowType::Utility
                || w.r#type == WindowType::Menu
        });

        //next floating
        let (level2, other): (Vec<&Window>, Vec<&Window>) = other
            .iter()
            .partition(|w| w.r#type == WindowType::Normal && w.floating());

        //then normal windows
        let (level3, other): (Vec<&Window>, Vec<&Window>) =
            other.iter().partition(|w| w.r#type == WindowType::Normal);

        //last docks
        //other is all the reset

        //build the updated window list
        self.windows = level1
            .iter()
            .chain(level2.iter())
            .chain(level3.iter())
            .chain(other.iter())
            .map(|&w| w.clone())
            .collect();
        let act = DisplayAction::SetWindowOrder(self.windows.clone());
        self.actions.push_back(act);
    }
//sorts the windows and puts them in order of importance
//keeps the order for each importance level
sorts the windows and puts them in order of importance
keeps the order for each importance level
sorts the windows and puts them in order of importance keeps the order for each importance level
pub fn sort_windows(&mut self) {
        use crate::models::WindowType;
        //first dialogs and modals
        let (level1, other): (Vec<&Window>, Vec<&Window>) = self.windows.iter().partition(|w| {
            w.r#type == WindowType::Dialog
                || w.r#type == WindowType::Splash
                || w.r#type == WindowType::Utility
                || w.r#type == WindowType::Menu
        });
        //next floating
        let (level2, other): (Vec<&Window>, Vec<&Window>) = other
            .iter()
            .partition(|w| w.r#type == WindowType::Normal && w.floating());
        //then normal windows
        let (level3, other): (Vec<&Window>, Vec<&Window>) =
            other.iter().partition(|w| w.r#type == WindowType::Normal);
        //last docks
        //other is all the reset
        //build the updated window list
        self.windows = level1
            .iter()
            .chain(level2.iter())
            .chain(level3.iter())
            .chain(other.iter())
            .map(|&w| w.clone())
            .collect();
        let act = DisplayAction::SetWindowOrder(self.windows.clone());
        self.actions.push_back(act);
    }
pub fn sort_windows ( & mut self ) { use crate :: models :: WindowType ; //first dialogs and modals let ( level1 , other ) : ( Vec < & Window > , Vec < & Window > ) = self . windows . iter ( ) . partition ( | w | { w . r#type == WindowType :: Dialog || w . r#type == WindowType :: Splash || w . r#type == WindowType :: Utility || w . r#type == WindowType :: Menu } ) ; //next floating let ( level2 , other ) : ( Vec < & Window > , Vec < & Window > ) = other . iter ( ) . partition ( | w | w . r#type == WindowType :: Normal && w . floating ( ) ) ; //then normal windows let ( level3 , other ) : ( Vec < & Window > , Vec < & Window > ) = other . iter ( ) . partition ( | w | w . r#type == WindowType :: Normal ) ; //last docks //other is all the reset //build the updated window list self . windows = level1 . iter ( ) . chain ( level2 . iter ( ) ) . chain ( level3 . iter ( ) ) . chain ( other . iter ( ) ) . map ( | & w | w . clone ( ) ) . collect ( ) ; let act = DisplayAction :: SetWindowOrder ( self . windows . clone ( ) ) ; self . actions . push_back ( act ) ; }
sorts the windows and puts them in order of importance
keeps the order for each importance level
sorts the windows and puts them in order of importance keeps the order for each importance level
&mut self
&mut self