[][src]Struct penrose::core::layout::Layout

pub struct Layout {
    pub conf: LayoutConf,
    pub symbol: &'static str,
    // some fields omitted
}

Responsible for arranging Clients within a Workspace.

A Layout is primarily a function that will be passed an array of Clients to apply resize actions to. Only clients that should be tiled for the current monitor will be passed so no checks are required to see if each client should be handled. The region passed to the layout function represents the current screen dimensions that can be utilised and gaps/borders will be added to each client by the WindowManager itself so there is no need to handle that in the layouts themselves. Layouts are expected to have a 'main area' that holds the clients with primary focus and any number of secondary areas for the remaining clients to be tiled. The user can increase/decrease the size of the main area by setting 'ratio' via key bindings which should determine the relative size of the main area compared to other cliens. Layouts maintain their own state for number of clients in the main area and ratio which will be passed through to the layout function when it is called.

Fields

conf: LayoutConf

How this layout should be applied by the WindowManager

symbol: &'static str

User defined symbol for displaying in the status bar

Implementations

impl Layout[src]

pub fn new(
    symbol: &'static str,
    conf: LayoutConf,
    f: LayoutFunc,
    max_main: u32,
    ratio: f32
) -> Layout
[src]

Create a new Layout for a specific monitor

pub fn floating(symbol: &'static str) -> Layout[src]

A default floating layout that will not attempt to manage windows

pub fn arrange(
    &self,
    clients: &[&Client],
    focused: Option<WinId>,
    r: &Region
) -> Vec<ResizeAction>
[src]

Apply the embedded layout function using the current n_main and ratio

pub fn update_max_main(&mut self, change: Change)[src]

Increase/decrease the number of clients in the main area by 1

pub fn update_main_ratio(&mut self, change: Change, step: f32)[src]

Increase/decrease the size of the main area relative to secondary. (clamps at 1.0 and 0.0 respectively)

Trait Implementations

impl Clone for Layout[src]

impl Copy for Layout[src]

impl Debug for Layout[src]

impl PartialEq<Layout> for Layout[src]

Auto Trait Implementations

impl RefUnwindSafe for Layout

impl Send for Layout

impl Sync for Layout

impl Unpin for Layout

impl UnwindSafe for Layout

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.