Struct SplitLayoutController

Source
pub struct SplitLayoutController {
    pub left: SplitController,
    pub right: SplitController,
    pub top: SplitController,
    pub bottom: SplitController,
    /* private fields */
}
Expand description

Stores information about split layout.

The layout is split into left, right, top and bottom panel.

Fields§

§left: SplitController

The left split controller.

§right: SplitController

The right split controller.

§top: SplitController

The top split controller.

§bottom: SplitController

The bottom split controller.

Implementations§

Source§

impl SplitLayoutController

Source

pub fn new(settings: &SplitLayoutSettings) -> SplitLayoutController

Creates a new SplitLayoutController.

Source

pub fn event<E: GenericEvent>( &mut self, rect: [f64; 4], transform: Matrix2x3<f64>, e: &E, )

Handles event.

Source

pub fn left_right_layout(&self, purpose: SplitLayoutPurpose) -> SplitLayout

Returns the left/right split layout.

The left/right split layout depends on whether your purpose is to draw something or handle events. When handling events, the rectangle overlaps with the top and bottom split.

Source

pub fn top_bottom_layout(&self) -> SplitLayout

Returns the top/bottom split layout.

Source

pub fn rectangles(&self, rect: [f64; 4]) -> [[f64; 4]; 4]

Computes split rectangles for drawing [left, right, top, bottom].

Source

pub fn states(&self) -> [SplitState; 4]

Returns the split controller states [left, right, top, bottom].

Source

pub fn panel_rectangles(&self, rect: [f64; 4]) -> [[f64; 4]; 5]

Computes panel rectangles for layout [left, right, top, bottom, center].

Source

pub fn min_size(&self) -> [f64; 2]

Computes the minimum size using current values in split controls.

The current values in the split controls are used instead of the minimum values, because the splits should appear visually with the same current value.

Source

pub fn bounds(&self, rect: [f64; 4]) -> [f64; 4]

Computes the bounds from window bounds [x, y, w, h].

Does not get less in size than specified by min_size.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.