pub struct Scroll {
pub id: Option<NodeId>,
pub child: Option<Box<Node>>,
pub direction: FlexDirection,
pub width: Option<f32>,
pub height: Option<f32>,
pub show_scrollbar: bool,
pub flex_grow: f32,
pub flex_shrink: f32,
}Expand description
A scrollable container that clips its child and tracks scroll offset.
Scroll direction can be horizontal (FlexDirection::Row) or vertical
(FlexDirection::Column). The runtime manages scroll state automatically
in response to pointer scroll events.
§Example
ⓘ
Scroll {
direction: FlexDirection::Column,
show_scrollbar: true,
flex_grow: 1.0,
child: Some(Box::new(long_content)),
..Default::default()
}Fields§
§id: Option<NodeId>Explicit node identity (used for scroll-offset tracking).
child: Option<Box<Node>>The scrollable content.
direction: FlexDirectionScroll axis: Column for vertical, Row for horizontal.
width: Option<f32>Fixed width in layout points.
height: Option<f32>Fixed height in layout points.
show_scrollbar: boolWhether to render a scrollbar indicator.
flex_grow: f32Flex grow factor.
flex_shrink: f32Flex shrink factor.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scroll
impl<'de> Deserialize<'de> for Scroll
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Lower for Scroll
impl Lower for Scroll
Source§fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
fn lower(&self, cx: &mut LoweringContext<'_>) -> NodeId
Lower this widget into the IR, returning the root node id.
Auto Trait Implementations§
impl Freeze for Scroll
impl !RefUnwindSafe for Scroll
impl Send for Scroll
impl Sync for Scroll
impl Unpin for Scroll
impl UnsafeUnpin for Scroll
impl !UnwindSafe for Scroll
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,
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.