[][src]Struct ytesrev::layout::split::Split

pub struct Split<T: Drawable, U: Drawable> {
    pub amount: Box<dyn Fn(u32) -> u32>,
    pub orientation: Orientation,
    pub order: UpdateOrder,
    pub first: T,
    pub second: U,
}

A split at a centain percent

Fields

amount: Box<dyn Fn(u32) -> u32>

How to split the window. The argument is the size of the window in the splitting direction (horizortal gives width, vertical gives height), and the return value is how many pixels the first element should take

orientation: Orientation

The orientation to split

order: UpdateOrder

The stepping order

first: T

The first content

second: U

The second content

Methods

impl<T: Drawable, U: Drawable> Split<T, U>[src]

pub fn new(
    amount: Box<dyn Fn(u32) -> u32>,
    orientation: Orientation,
    order: UpdateOrder,
    first: T,
    second: U
) -> Split<T, U>
[src]

Create a new Split

pub fn new_ratio(
    ratio: f64,
    orientation: Orientation,
    order: UpdateOrder,
    first: T,
    second: U
) -> Split<T, U>
[src]

Create a new Split that splits by a ratio. The ratio must be between 0 and 1.

pub fn new_const(
    pixels: u32,
    orientation: Orientation,
    order: UpdateOrder,
    first: T,
    second: U
) -> Split<T, U>
[src]

Create a new Split that split by a constant number of pixels.

Trait Implementations

impl<T: Drawable, U: Drawable> Drawable for Split<T, U>[src]

fn register(&mut self)[src]

Register all content. This is mostly just used by [LatexObj]s, that need to be registered before loaded. Read more

fn load(&mut self)[src]

Load all content

fn event(&mut self, e: Event)[src]

When any event occurs

fn update(&mut self, dt: f64)[src]

Tick the object

impl<T: Drawable, U: Drawable> Send for Split<T, U>[src]

Auto Trait Implementations

impl<T, U> Unpin for Split<T, U> where
    T: Unpin,
    U: Unpin

impl<T, U> !Sync for Split<T, U>

impl<T, U> !UnwindSafe for Split<T, U>

impl<T, U> !RefUnwindSafe for Split<T, U>

Blanket Implementations

impl<T> Layerable for T where
    T: Drawable
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,