Trait cosmic::iced_runtime::core::widget::operation::Scrollable
source · pub trait Scrollable {
// Required methods
fn snap_to(&mut self, offset: RelativeOffset);
fn scroll_to(&mut self, offset: AbsoluteOffset);
fn scroll_by(
&mut self,
offset: AbsoluteOffset,
bounds: Rectangle,
content_bounds: Rectangle,
);
}
Expand description
The internal state of a widget that can be scrolled.
Required Methods§
sourcefn snap_to(&mut self, offset: RelativeOffset)
fn snap_to(&mut self, offset: RelativeOffset)
Snaps the scroll of the widget to the given percentage
along the horizontal & vertical axis.
sourcefn scroll_to(&mut self, offset: AbsoluteOffset)
fn scroll_to(&mut self, offset: AbsoluteOffset)
Scroll the widget to the given AbsoluteOffset
along the horizontal & vertical axis.
sourcefn scroll_by(
&mut self,
offset: AbsoluteOffset,
bounds: Rectangle,
content_bounds: Rectangle,
)
fn scroll_by( &mut self, offset: AbsoluteOffset, bounds: Rectangle, content_bounds: Rectangle, )
Scroll the widget by the given AbsoluteOffset
along the horizontal & vertical axis.