Skip to main content

WindowLayoutState

Struct WindowLayoutState 

Source
pub struct WindowLayoutState<W: Window<I>, I: ApplicationInfo> { /* private fields */ }
Expand description

Manages the current layout and focus of Windows on the screen.

Implementations§

Source§

impl<W, I> WindowLayoutState<W, I>
where W: Window<I>, I: ApplicationInfo,

Source

pub fn new(window: W) -> Self

Create a new instance containing a single Window.

Source

pub fn empty() -> Self

Create a new instance without any windows.

Source

pub fn as_description(&self) -> WindowLayoutRoot<I>

Convert this layout to a serializable summary of its windows and splits.

Source

pub fn from_target( &self, target: &OpenTarget<I::WindowId>, ctx: &EditContext, store: &mut Store<I>, ) -> UIResult<Self, I>

Create a new instance containing a single Window displaying some content.

Source

pub fn get(&self) -> Option<&W>

Fetch a reference to the currently focused Window.

Source

pub fn get_mut(&mut self) -> Option<&mut W>

Fetch a mutable reference the currently focused Window.

Source

pub fn extract(&mut self) -> Self

Extract the currently focused Window into its own window layout.

Trait Implementations§

Source§

impl<W, C, I> Jumpable<C, I> for WindowLayoutState<W, I>
where W: Window<I> + Jumpable<C, I>, I: ApplicationInfo,

Source§

fn jump( &mut self, list: PositionList, dir: MoveDir1D, count: usize, ctx: &C, ) -> UIResult<usize, I>

Move through a PositionList in MoveDir1D direction count times. Read more
Source§

impl<W, I> WindowContainer<EditContext, Store<I>, I> for WindowLayoutState<W, I>
where W: Window<I>, I: ApplicationInfo,

Source§

fn window_command( &mut self, action: &WindowAction<I>, ctx: &EditContext, store: &mut Store<I>, ) -> UIResult<EditInfo, I>

Execute a window action.
Source§

impl<W, I> WindowCount for WindowLayoutState<W, I>
where W: Window<I>, I: ApplicationInfo,

Source§

fn windows(&self) -> usize

Number of currently open windows.

Auto Trait Implementations§

§

impl<W, I> Freeze for WindowLayoutState<W, I>

§

impl<W, I> RefUnwindSafe for WindowLayoutState<W, I>

§

impl<W, I> Send for WindowLayoutState<W, I>
where I: Send, W: Send,

§

impl<W, I> Sync for WindowLayoutState<W, I>
where I: Sync, W: Sync,

§

impl<W, I> Unpin for WindowLayoutState<W, I>
where I: Unpin,

§

impl<W, I> UnsafeUnpin for WindowLayoutState<W, I>

§

impl<W, I> UnwindSafe for WindowLayoutState<W, I>
where I: UnwindSafe, W: UnwindSafe,

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
Source§

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