pub struct BackgroundNode { /* private fields */ }Expand description
Node that draws a background behind its content.
Implementations§
Source§impl BackgroundNode
impl BackgroundNode
Sourcepub fn new(color: Color) -> BackgroundNode
pub fn new(color: Color) -> BackgroundNode
Creates a node that fills its bounds with color behind its content, with square corners.
Sourcepub fn shape(&self) -> Option<RoundedCornerShape>
pub fn shape(&self) -> Option<RoundedCornerShape>
Returns the corner shape of the fill, or None for square corners.
Trait Implementations§
Source§impl Debug for BackgroundNode
impl Debug for BackgroundNode
Source§impl DelegatableNode for BackgroundNode
impl DelegatableNode for BackgroundNode
Source§fn node_state(&self) -> &NodeState
fn node_state(&self) -> &NodeState
The runtime state of this node. Return a
NodeState field of the node; the chain uses it to
link the node and to track its capabilities.Source§fn aggregate_child_capabilities(&self) -> NodeCapabilities
fn aggregate_child_capabilities(&self) -> NodeCapabilities
The union of the capabilities of this node and of every node after it in the chain.
Source§impl DrawModifierNode for BackgroundNode
impl DrawModifierNode for BackgroundNode
Source§fn create_draw_closure(&self) -> Option<Rc<dyn Fn(&mut DrawScopeDefault<'_>)>>
fn create_draw_closure(&self) -> Option<Rc<dyn Fn(&mut DrawScopeDefault<'_>)>>
Creates a closure for deferred drawing that will be evaluated at render time. Read more
Source§fn create_behind_draw_closure(
&self,
) -> Option<Rc<dyn Fn(&mut DrawScopeDefault<'_>)>>
fn create_behind_draw_closure( &self, ) -> Option<Rc<dyn Fn(&mut DrawScopeDefault<'_>)>>
Like
create_draw_closure, but the
primitives render BEHIND the node’s content — e.g. a text field’s
selection highlight, which must sit under the glyphs (a highlight
drawn over them tints the text with its translucent fill).Source§impl ModifierNode for BackgroundNode
impl ModifierNode for BackgroundNode
Source§fn on_attach(&mut self, context: &mut dyn ModifierNodeContext)
fn on_attach(&mut self, context: &mut dyn ModifierNodeContext)
Called once when the node joins an attached chain.
context receives the invalidation
requests of the node.Source§fn as_draw_node(&self) -> Option<&(dyn DrawModifierNode + 'static)>
fn as_draw_node(&self) -> Option<&(dyn DrawModifierNode + 'static)>
Returns this node as a draw modifier if it implements the trait.
Source§fn as_draw_node_mut(&mut self) -> Option<&mut (dyn DrawModifierNode + 'static)>
fn as_draw_node_mut(&mut self) -> Option<&mut (dyn DrawModifierNode + 'static)>
Returns this node as a mutable draw modifier if it implements the trait.
Source§fn on_detach(&mut self)
fn on_detach(&mut self)
Called when the node leaves the chain or when the chain detaches. Release here whatever
on_attach acquired.Source§fn on_reset(&mut self)
fn on_reset(&mut self)
Called when the chain is reset, as Compose’s
onReset. Clear state that belongs to an
earlier use of the node.Source§fn as_pointer_input_node(&self) -> Option<&(dyn PointerInputNode + 'static)>
fn as_pointer_input_node(&self) -> Option<&(dyn PointerInputNode + 'static)>
Returns this node as a pointer-input modifier if it implements the trait.
Source§fn as_pointer_input_node_mut(
&mut self,
) -> Option<&mut (dyn PointerInputNode + 'static)>
fn as_pointer_input_node_mut( &mut self, ) -> Option<&mut (dyn PointerInputNode + 'static)>
Returns this node as a mutable pointer-input modifier if it implements the trait.
Source§fn as_semantics_node(&self) -> Option<&(dyn SemanticsNode + 'static)>
fn as_semantics_node(&self) -> Option<&(dyn SemanticsNode + 'static)>
Returns this node as a semantics modifier if it implements the trait.
Source§fn as_semantics_node_mut(
&mut self,
) -> Option<&mut (dyn SemanticsNode + 'static)>
fn as_semantics_node_mut( &mut self, ) -> Option<&mut (dyn SemanticsNode + 'static)>
Returns this node as a mutable semantics modifier if it implements the trait.
Source§fn as_focus_node(&self) -> Option<&(dyn FocusNode + 'static)>
fn as_focus_node(&self) -> Option<&(dyn FocusNode + 'static)>
Returns this node as a focus modifier if it implements the trait.
Source§fn as_focus_node_mut(&mut self) -> Option<&mut (dyn FocusNode + 'static)>
fn as_focus_node_mut(&mut self) -> Option<&mut (dyn FocusNode + 'static)>
Returns this node as a mutable focus modifier if it implements the trait.
Source§fn as_layout_node(&self) -> Option<&(dyn LayoutModifierNode + 'static)>
fn as_layout_node(&self) -> Option<&(dyn LayoutModifierNode + 'static)>
Returns this node as a layout modifier if it implements the trait.
Source§fn as_layout_node_mut(
&mut self,
) -> Option<&mut (dyn LayoutModifierNode + 'static)>
fn as_layout_node_mut( &mut self, ) -> Option<&mut (dyn LayoutModifierNode + 'static)>
Returns this node as a mutable layout modifier if it implements the trait.
Source§fn for_each_delegate<'b>(
&'b self,
_visitor: &mut dyn FnMut(&'b (dyn ModifierNode + 'static)),
)
fn for_each_delegate<'b>( &'b self, _visitor: &mut dyn FnMut(&'b (dyn ModifierNode + 'static)), )
Visits every delegate node owned by this modifier.
Source§fn for_each_delegate_mut<'b>(
&'b mut self,
_visitor: &mut dyn FnMut(&'b mut (dyn ModifierNode + 'static)),
)
fn for_each_delegate_mut<'b>( &'b mut self, _visitor: &mut dyn FnMut(&'b mut (dyn ModifierNode + 'static)), )
Visits every delegate node mutably.
Auto Trait Implementations§
impl !Freeze for BackgroundNode
impl !RefUnwindSafe for BackgroundNode
impl !Sync for BackgroundNode
impl Send for BackgroundNode
impl Unpin for BackgroundNode
impl UnsafeUnpin for BackgroundNode
impl UnwindSafe for BackgroundNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.