pub struct WindowLayout {
pub windows: Vec<Window>,
/* private fields */
}Expand description
Window layout for a session.
Manages the windows in a session, including which window is active.
Fields§
§windows: Vec<Window>All windows in this session.
Implementations§
Source§impl WindowLayout
impl WindowLayout
Sourcepub fn add(&mut self, window: Window)
pub fn add(&mut self, window: Window)
Add a window to the layout.
If this is the first window, it becomes active.
Sourcepub fn active(&self) -> Option<&Window>
pub fn active(&self) -> Option<&Window>
Get the active window.
If no window is explicitly active but windows exist, returns the first window. This ensures a valid window is always available when the layout is non-empty.
Sourcepub fn active_mut(&mut self) -> Option<&mut Window>
pub fn active_mut(&mut self) -> Option<&mut Window>
Get the active window mutably.
If no window is explicitly active but windows exist, returns the first window. This ensures a valid window is always available when the layout is non-empty.
Sourcepub fn set_active(&mut self, id: WindowId) -> bool
pub fn set_active(&mut self, id: WindowId) -> bool
Set the active window by ID.
Returns true if the window was found and made active.
Trait Implementations§
Source§impl Clone for WindowLayout
impl Clone for WindowLayout
Source§fn clone(&self) -> WindowLayout
fn clone(&self) -> WindowLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowLayout
impl Debug for WindowLayout
Source§impl Default for WindowLayout
impl Default for WindowLayout
Source§fn default() -> WindowLayout
fn default() -> WindowLayout
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WindowLayout
impl RefUnwindSafe for WindowLayout
impl Send for WindowLayout
impl Sync for WindowLayout
impl Unpin for WindowLayout
impl UnsafeUnpin for WindowLayout
impl UnwindSafe for WindowLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more