Struct cursive::view::scroll::Core [−][src]
pub struct Core { /* fields omitted */ }
Expand description
Core system for scrolling views.
This is the lowest-level element handling scroll logic.
Higher-level abstractions are probably what you’re after.
In particular, see also ScrollView
.
Implementations
Returns a sub-printer ready to draw the content.
Returns true
if event
should be processed by the content.
This also updates event
so that it is relative to the content.
Returns true
if we should relayout, no matter the content.
Even if this returns false
, the content itself might still needs to relayout.
Performs View::call_on_any()
pub fn focus_view<F>(
&mut self,
selector: &Selector<'_>,
inner_focus_view: F
) -> Result<(), ViewNotFound> where
F: FnOnce(&Selector<'_>) -> Result<(), ViewNotFound>,
pub fn focus_view<F>(
&mut self,
selector: &Selector<'_>,
inner_focus_view: F
) -> Result<(), ViewNotFound> where
F: FnOnce(&Selector<'_>) -> Result<(), ViewNotFound>,
Performs View::focus_view()
Returns the viewport in the inner content.
Defines the way scrolling is adjusted on content or size change.
The scroll strategy defines how the scrolling position is adjusted when the size of the view or the content change.
It is reset to ScrollStrategy::KeepRow
whenever the user scrolls
manually.
Defines the way scrolling is adjusted on content or size change.
Chainable variant.
Sets the padding between content and scrollbar.
Sets the padding between content and scrollbar.
Chainable variant.
Returns the padding between content and scrollbar.
For each axis, returns true
if this view can scroll.
For example, a vertically-scrolling view will return
XY { x: false, y: true }
.
Control whether scroll bars are visibile.
Defaults to true
.
Control whether scroll bars are visibile.
Chainable variant
Returns true
if we will show scrollbars when needed.
Scrollbars are always hidden when not needed.
Returns the size given to the content on the last layout phase.
Sets the scroll offset to the given value
Controls whether this view can scroll vertically.
Defaults to true
.
Controls whether this view can scroll horizontally.
Defaults to false
.
Controls whether this view can scroll vertically.
Defaults to true
.
Chainable variant.
Controls whether this view can scroll horizontally.
Defaults to false
.
Chainable variant.
Try to keep the given rect
in view.
Scrolls until the given rect is in view.
Scroll until the given column is visible.
Scroll until the given row is visible.
Scroll by n
cells to the left.
Scroll by n
cells to the bottom.
Scroll by n
cells to the right.
Programmatically scroll to the top of the view.
Programmatically scroll to the bottom of the view.
Programmatically scroll to the leftmost side of the view.
Programmatically scroll to the rightmost side of the view.
Returns for each axis if we are scrolling.
Stops grabbing the scrollbar.
Returns the size taken by the scrollbars.
Will be zero in axis where we’re not scrolling.
The scrollbar_size().x will be the horizontal space taken by the vertical scrollbar.
Returns the last size available for the child view.
Returns the last size given by layout
.
Checks if we can scroll up.
Returns true
if vertical scrolling is enabled, and if we are not at
the top already.
Checks if we can scroll to the left.
Returns true
if horizontal scrolling is enabled, and if we are not at
the left edge already.
Checks if we can scroll down.
Returns true
if vertical scrolling is enabled, and if we are not at
the bottom already.
Checks if we can scroll to the right.
Returns true
if horizontal scrolling is enabled, and if we are not at
the right edge already.
Starts scrolling from the cursor position.
Returns true
if the event was consumed.