Trait Settling

Source
pub trait Settling {
Show 14 methods // Required methods fn settle( &mut self, target: &mut Frame, area: Option<Area>, sa: &mut dyn SurfaceAccess, ); fn resettle( &mut self, target: &mut Frame, position: Option<Position>, sa: &mut dyn SurfaceAccess, ); fn pop_recursively(&mut self, pop: &mut Frame); fn change_geometry( &mut self, geometry: Geometry, sa: &mut dyn SurfaceAccess, ); fn ramify(&mut self, geometry: Geometry) -> Frame; fn deramify(&mut self); fn jumpin( &mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess, ); fn jump( &mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess, ); fn dock( &mut self, target: &mut Frame, size: Size, sa: &mut dyn SurfaceAccess, ); fn anchorize(&mut self, sa: &mut dyn SurfaceAccess); fn deanchorize(&mut self, area: Area, sa: &mut dyn SurfaceAccess); fn resize( &mut self, direction: Direction, magnitude: isize, sa: &mut dyn SurfaceAccess, ); fn move_with_contents(&mut self, vector: Vector); fn destroy_self(&mut self, sa: &mut dyn SurfaceAccess);
}
Expand description

Extension trait for Frame adding more settling functionality.

Required Methods§

Source

fn settle( &mut self, target: &mut Frame, area: Option<Area>, sa: &mut dyn SurfaceAccess, )

Settle self in buildable of target and relax it.

If area is provided settle the surface as floating with given position and size.

Source

fn resettle( &mut self, target: &mut Frame, position: Option<Position>, sa: &mut dyn SurfaceAccess, )

Remove given frame, relax old parent and settle the frame on given target.

If frame is floating and optional position is given it will be used to place the frame.

Source

fn pop_recursively(&mut self, pop: &mut Frame)

Pop the surface pop and its parents inside surface self.

After calling this function pop will be most recently used frame inside self.

Source

fn change_geometry(&mut self, geometry: Geometry, sa: &mut dyn SurfaceAccess)

Changes frames geometry and resizes all subframe accordingly.

Source

fn ramify(&mut self, geometry: Geometry) -> Frame

Adds another container into given place in frame layout if needed.

This method is used when jumping into leaf frame to create container to handle the leaf and jumped frame.

Returns

  • self if it is container with one child,
  • parent if parent has one child
  • newly created container frame otherwise

Returned frame is guarantied to have exactly one child.

Source

fn deramify(&mut self)

Removes unnecessary layers of container frames containing only one container or leaf frame.

Source

fn jumpin(&mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess)

Places frame self on given side of target frame.

Source

fn jump(&mut self, side: Side, target: &mut Frame, sa: &mut dyn SurfaceAccess)

Removes frame self from frame layout and then places it using jumpin method.

Source

fn dock(&mut self, target: &mut Frame, size: Size, sa: &mut dyn SurfaceAccess)

Places frame self in target frame as dock.

Source

fn anchorize(&mut self, sa: &mut dyn SurfaceAccess)

Anchorizes floating frame.

Source

fn deanchorize(&mut self, area: Area, sa: &mut dyn SurfaceAccess)

Deanchorizes frame. Floating frame must be attached to workspace so it will be resettled if necessary.

Source

fn resize( &mut self, direction: Direction, magnitude: isize, sa: &mut dyn SurfaceAccess, )

Resize the frame. direction indicates the border which will be moved and magnitude is move distance in pixels.

Source

fn move_with_contents(&mut self, vector: Vector)

Move the frame and all subframes by given vector.

Source

fn destroy_self(&mut self, sa: &mut dyn SurfaceAccess)

Removes frame self, relaxes old parent and destroys the frame.

Implementors§