Struct penrose::builtin::layout::Grid

source ·
pub struct Grid;
Expand description

A simple grid layout that places windows in the smallest nxn grid that will contain all window present on the workspace.

..................................
.          .          .          .
.          .          .          .
.          .          .          .
..................................
.          .          .          .
.          .          .          .
.          .          .          .
..................................
.          .          .          .
.          .          .          .
.          .          .          .
..................................

NOTE

This will leave unused screen space if there are not a square number of windows present in the workspace being laid out:

..................................
.          .          .          .
.          .          .          .
.          .          .          .
..................................
.          .          .          .
.          .          .          .
.          .          .          .
..................................
.          .          .
.          .          .
.          .          .
.......................

Implementations§

source§

impl Grid

source

pub fn boxed() -> Box<dyn Layout>

Create a new Grid Layout as a boxed trait object

Trait Implementations§

source§

impl Clone for Grid

source§

fn clone(&self) -> Grid

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Grid

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Grid

source§

fn default() -> Grid

Returns the “default value” for a type. Read more
source§

impl Layout for Grid

source§

fn name(&self) -> String

A short display name for this Layout, appropriate for rendering in a status bar as an indicator of which layout is currently being used.
source§

fn boxed_clone(&self) -> Box<dyn Layout>

Provide a clone of this Layout wrapped as a trait object. (Trait objects can not require Clone directly)
source§

fn layout( &mut self, s: &Stack<Xid>, r: Rect ) -> (Option<Box<dyn Layout>>, Vec<(Xid, Rect)>)

Generate screen positions for clients from a given Stack. Read more
source§

fn handle_message(&mut self, _: &Message) -> Option<Box<dyn Layout>>

Process a dynamic Message. Read more
source§

fn boxed(self) -> Box<dyn Layout>
where Self: Sized + 'static,

Convert to a trait object.
source§

fn layout_workspace( &mut self, tag: &str, stack: &Option<Stack<Xid>>, r: Rect ) -> (Option<Box<dyn Layout>>, Vec<(Xid, Rect)>)

Generate screen positions for clients on a given crate::pure::Workspace. Read more
source§

fn layout_empty( &mut self, r: Rect ) -> (Option<Box<dyn Layout>>, Vec<(Xid, Rect)>)

Generate screen positions for an empty Stack. Read more
source§

impl Copy for Grid

Auto Trait Implementations§

§

impl RefUnwindSafe for Grid

§

impl Send for Grid

§

impl Sync for Grid

§

impl Unpin for Grid

§

impl UnwindSafe for Grid

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Any for T
where T: Any,

source§

impl<T> CloneAny for T
where T: Any + Clone,