pub struct LayoutDefinition {
    pub name: String,
    pub column_type: ColumnType,
    pub flipped: Flipped,
    pub rotation: Rotation,
    pub main_window_count: usize,
    pub main_size: Size,
    pub main_split: SplitAxis,
    pub stack_split: SplitAxis,
    pub reserve_column_space: ReserveColumnSpace,
    pub balance_stacks: bool,
}

Fields

name: String

The unique identifier for the layout, there can be only one layout with the same name. If a layout is defined multiple times, it may be overwritten.

column_type: ColumnType

The column type used in this layout. This usually isn’t changed during runtime. See ColumnType for details.

flipped: Flipped

See Flipped for details.

rotation: Rotation

See Rotation for details.

main_window_count: usize

Determines the amount of windows to show in the main column of the layout. If the layout has no main column, this modifier will be ignored.

main_size: Size

The Size of the available space which the main column should occupy. If the layout has no main column, or no window in the main column, this modifier will be ignored. Value can either be absolute Pixels (400px) or a Ratio (eg. 0.5). Defaults to 0.5, meaning 50%.

main_split: SplitAxis

The way to split windows in the main_column when there are more than one window. If the layout has no main column, or no window in the main column, this modifier will be ignored. See SplitAxis for details. Defaults to SplitAxis::Vertical

stack_split: SplitAxis

The way to split windows in the stack_column(s) when there are more than one window. See SplitAxis for details.

reserve_column_space: ReserveColumnSpace

The way to handle empty column space where there is no window. See ReserveColumnSpace for details.

balance_stacks: bool

When set to true stack windows are distributed evenly between stacks, when set to false the first stack gets a single window, and the rest of the windows go to the second stack. This modifier is ignored in layouts that have just one stack

Demonstration

When set to true

+-----+-------+-----+
|  2  |       |  4  |
|     |       |     |
|-----|   1   |-----|
|  3  |       |  5  |
|     |       |     |
+-----+-------+-----+

When set to false

+-----+-------+-----+
|     |       |  3  |
|     |       |-----|
|  2  |   1   |  4  |
|     |       |-----|
|     |       |  5  |
+-----+-------+-----+

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.