pub struct Core { /* private fields */ }
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

Creates a new Core.

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()

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 point is visible.

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 top.

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.

Called when a mouse drag is detected.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.