pub fn viewport(&self, screen_width: u32, screen_height: u32) -> Viewport {
        let (left, right, top, bottom) = self
            .vec
            .borrow()
            .iter()
            .filter_map(|o| o.strut_partial.as_ref())
            .fold((0, 0, 0, 0), |(left, right, top, bottom), s| {
                // We don't bother looking at the start/end members of the
                // StrutPartial - treating it more like a Strut.
                (
                    cmp::max(left, s.left()),
                    cmp::max(right, s.right()),
                    cmp::max(top, s.top()),
                    cmp::max(bottom, s.bottom()),
                )
            });
        let viewport = Viewport {
            x: left,
            y: top,
            width: screen_width - left - right,
            height: screen_height - top - bottom,
        };
        debug!("Calculated Viewport as {:?}", viewport);
        viewport
    }
/// Figure out the usable area of the screen based on the STRUT_PARTIAL of
/// all docks.
Figure out the usable area of the screen based on the STRUT_PARTIAL of
all docks.
Figure out the usable area of the screen based on the STRUT_PARTIAL of all docks .
pub fn viewport(&self, screen_width: u32, screen_height: u32) -> Viewport {
        let (left, right, top, bottom) = self
            .vec
            .borrow()
            .iter()
            .filter_map(|o| o.strut_partial.as_ref())
            .fold((0, 0, 0, 0), |(left, right, top, bottom), s| {
                // We don't bother looking at the start/end members of the
                // StrutPartial - treating it more like a Strut.
                (
                    cmp::max(left, s.left()),
                    cmp::max(right, s.right()),
                    cmp::max(top, s.top()),
                    cmp::max(bottom, s.bottom()),
                )
            });
        let viewport = Viewport {
            x: left,
            y: top,
            width: screen_width - left - right,
            height: screen_height - top - bottom,
        };
        debug!("Calculated Viewport as {:?}", viewport);
        viewport
    }
pub fn viewport ( & self , screen_width : u32 , screen_height : u32 ) -> Viewport { let ( left , right , top , bottom ) = self . vec . borrow ( ) . iter ( ) . filter_map ( | o | o . strut_partial . as_ref ( ) ) . fold ( ( 0 , 0 , 0 , 0 ) , | ( left , right , top , bottom ) , s | { // We don't bother looking at the start/end members of the // StrutPartial - treating it more like a Strut. ( cmp :: max ( left , s . left ( ) ) , cmp :: max ( right , s . right ( ) ) , cmp :: max ( top , s . top ( ) ) , cmp :: max ( bottom , s . bottom ( ) ) , ) } ) ; let viewport = Viewport { x : left , y : top , width : screen_width - left - right , height : screen_height - top - bottom , } ; debug ! ( " " viewport ) ; viewport }
Figure out the usable area of the screen based on the STRUT_PARTIAL of
all docks.
Figure out the usable area of the screen based on the STRUT_PARTIAL of all docks .
&self
screen_width
u32
screen_height
u32