Struct cursive::views::ScrollView [−][src]
pub struct ScrollView<V> { /* fields omitted */ }
Wraps a view in a scrollable area.
Methods
impl<V> ScrollView<V> where
V: View,
[src]
impl<V> ScrollView<V> where
V: View,
pub fn new(inner: V) -> Self
[src]
pub fn new(inner: V) -> Self
Creates a new ScrollView around view
.
pub fn content_viewport(&self) -> Rect
[src]
pub fn content_viewport(&self) -> Rect
Returns the viewport in the inner content.
pub fn set_scroll_strategy(&mut self, strategy: ScrollStrategy)
[src]
pub fn set_scroll_strategy(&mut self, strategy: ScrollStrategy)
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.
pub fn scroll_strategy(self, strategy: ScrollStrategy) -> Self
[src]
pub fn scroll_strategy(self, strategy: ScrollStrategy) -> Self
Defines the way scrolling is adjusted on content or size change.
Chainable variant.
pub fn set_offset<S>(&mut self, offset: S) where
S: Into<Vec2>,
[src]
pub fn set_offset<S>(&mut self, offset: S) where
S: Into<Vec2>,
Sets the scroll offset to the given value
pub fn set_scroll_y(&mut self, enabled: bool)
[src]
pub fn set_scroll_y(&mut self, enabled: bool)
Controls whether this view can scroll vertically.
Defaults to true
.
pub fn set_scroll_x(&mut self, enabled: bool)
[src]
pub fn set_scroll_x(&mut self, enabled: bool)
Controls whether this view can scroll horizontally.
Defaults to false
.
pub fn scroll_y(self, enabled: bool) -> Self
[src]
pub fn scroll_y(self, enabled: bool) -> Self
Controls whether this view can scroll vertically.
Defaults to true
.
Chainable variant.
pub fn scroll_x(self, enabled: bool) -> Self
[src]
pub fn scroll_x(self, enabled: bool) -> Self
Controls whether this view can scroll horizontally.
Defaults to false
.
Chainable variant.
pub fn scroll_to_top(&mut self)
[src]
pub fn scroll_to_top(&mut self)
Programmatically scroll to the top of the view.
pub fn scroll_to_bottom(&mut self)
[src]
pub fn scroll_to_bottom(&mut self)
Programmatically scroll to the bottom of the view.
pub fn scroll_to_left(&mut self)
[src]
pub fn scroll_to_left(&mut self)
Programmatically scroll to the leftmost side of the view.
pub fn scroll_to_right(&mut self)
[src]
pub fn scroll_to_right(&mut self)
Programmatically scroll to the rightmost side of the view.
Trait Implementations
impl<V> View for ScrollView<V> where
V: View,
[src]
impl<V> View for ScrollView<V> where
V: View,
fn draw(&self, printer: &Printer)
[src]
fn draw(&self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus. Read more
fn on_event(&mut self, event: Event) -> EventResult
[src]
fn on_event(&mut self, event: Event) -> EventResult
Called when an event is received (key press, mouse event, ...). Read more
fn layout(&mut self, size: Vec2)
[src]
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided. Read more
fn needs_relayout(&self) -> bool
[src]
fn needs_relayout(&self) -> bool
Returns true
if the view content changed since last layout phase. Read more
fn required_size(&mut self, constraint: Vec2) -> Vec2
[src]
fn required_size(&mut self, constraint: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions. Read more
fn call_on_any<'a>(&mut self, selector: &Selector, cb: AnyCb<'a>)
[src]
fn call_on_any<'a>(&mut self, selector: &Selector, cb: AnyCb<'a>)
Runs a closure on the view identified by the given selector. Read more
fn focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
fn focus_view(&mut self, selector: &Selector) -> Result<(), ()>
Moves the focus to the view identified by the given selector. Read more
fn take_focus(&mut self, source: Direction) -> bool
[src]
fn take_focus(&mut self, source: Direction) -> bool
This view is offered focus. Will it take it? Read more
fn important_area(&self, view_size: Vec2) -> Rect
[src]
fn important_area(&self, view_size: Vec2) -> Rect
What part of the view is important and should be visible? Read more
Auto Trait Implementations
impl<V> Send for ScrollView<V> where
V: Send,
impl<V> Send for ScrollView<V> where
V: Send,
impl<V> Sync for ScrollView<V> where
V: Sync,
impl<V> Sync for ScrollView<V> where
V: Sync,