pub struct LayoutNode { /* private fields */ }
Expand description
A single node of a layout tree.
LayoutNode
s allow you to hierarchically represent layouts in a tree structure.
They have the following properties:
- A layout direction, set with
set_dir
: This determines the direction that children layout nodes are laid out in. - A size proportion, set with
set_size_proportion
: This determines the proportion of space a layout node takes up in relation to its siblings. - Gaps, set with
set_gaps
: This determines the gaps surrounding a layout node. - A traversal index, set with
set_traversal_index
: This determines the order that the layout tree is traversed in when assigning layout node geometries to windows. - Traversal overrides, set with
set_traversal_overrides
: This provides a way to provide per-window overrides to tree traversal. This is used to enable otherwise impossible window insertion strategies. For example, theCorner
layout generator overrides traversal to allow windows to be inserted into the vertical and horizontal stacks in an alternating fashion. - An optional label, set with
set_label
: This gives the compositor a hint when diffing layout trees, allowing it to, for example, decide whether to move a node or delete it and insert a new one.
Implementations§
Source§impl LayoutNode
impl LayoutNode
Sourcepub fn new_with_label(label: impl ToString) -> Self
pub fn new_with_label(label: impl ToString) -> Self
Creates a new layout node with the given label.
Sourcepub fn new_with_traversal_index(index: u32) -> Self
pub fn new_with_traversal_index(index: u32) -> Self
Creates a new layout node with the given traversal index.
Sourcepub fn new_with_label_and_index(label: impl ToString, index: u32) -> Self
pub fn new_with_label_and_index(label: impl ToString, index: u32) -> Self
Creates a new layout node with the given label and traversal index.
Sourcepub fn set_traversal_overrides(
&self,
overrides: impl IntoIterator<Item = (u32, Vec<u32>)>,
)
pub fn set_traversal_overrides( &self, overrides: impl IntoIterator<Item = (u32, Vec<u32>)>, )
Sets this node’s traversal overrides, allowing it to change how windows are assigned geometries.
Sourcepub fn set_traversal_index(&self, index: u32)
pub fn set_traversal_index(&self, index: u32)
Sets this node’s traversal index, changing how the compositor traverses the tree when assigning geometries to windows.
Sourcepub fn set_children(&self, children: impl IntoIterator<Item = Self>)
pub fn set_children(&self, children: impl IntoIterator<Item = Self>)
Sets this node’s children.
Sourcepub fn set_size_proportion(&self, proportion: f32)
pub fn set_size_proportion(&self, proportion: f32)
Sets this node’s size proportion in relation to its siblings.
Trait Implementations§
Source§impl Clone for LayoutNode
impl Clone for LayoutNode
Source§fn clone(&self) -> LayoutNode
fn clone(&self) -> LayoutNode
Returns a copy 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 LayoutNode
impl Debug for LayoutNode
Source§impl Default for LayoutNode
impl Default for LayoutNode
Source§impl From<LayoutNode> for LayoutNode
impl From<LayoutNode> for LayoutNode
Source§fn from(value: LayoutNode) -> Self
fn from(value: LayoutNode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LayoutNode
impl PartialEq for LayoutNode
Auto Trait Implementations§
impl Freeze for LayoutNode
impl !RefUnwindSafe for LayoutNode
impl !Send for LayoutNode
impl !Sync for LayoutNode
impl Unpin for LayoutNode
impl !UnwindSafe for LayoutNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered
].