Struct cursive::views::StackView
[−]
[src]
pub struct StackView { /* fields omitted */ }
Simple stack of views. Only the top-most view is active and can receive input.
Methods
impl StackView
[src]
pub fn new() -> Self
[src]
Creates a new empty StackView
pub fn add_fullscreen_layer<T>(&mut self, view: T) where
T: 'static + View,
[src]
T: 'static + View,
Adds a new full-screen layer on top of the stack.
Fullscreen layers have no shadow.
pub fn add_layer<T>(&mut self, view: T) where
T: 'static + View,
[src]
T: 'static + View,
Adds new view on top of the stack in the center of the screen.
pub fn layer<T>(self, view: T) -> Self where
T: 'static + View,
[src]
T: 'static + View,
Adds new view on top of the stack in the center of the screen.
Chainable variant.
pub fn fullscreen_layer<T>(self, view: T) -> Self where
T: 'static + View,
[src]
T: 'static + View,
Adds a new full-screen layer on top of the stack.
Chainable variant.
pub fn add_layer_at<T>(&mut self, position: Position, view: T) where
T: 'static + View,
[src]
T: 'static + View,
Adds a view on top of the stack.
pub fn layer_at<T>(self, position: Position, view: T) -> Self where
T: 'static + View,
[src]
T: 'static + View,
Adds a view on top of the stack.
Chainable variant.
pub fn pop_layer(&mut self) -> Option<Box<AnyView>>
[src]
Remove the top-most layer.
pub fn offset(&self) -> Vec2
[src]
Computes the offset of the current top view.
pub fn layer_sizes(&self) -> Vec<Vec2>
[src]
Returns the size for each layer in this view.
pub fn move_layer(&mut self, from: LayerPosition, to: LayerPosition)
[src]
Moves a layer to a new position in the stack.
This only affects the elevation of a layer (whether it is drawn over or under other views).
pub fn move_to_front(&mut self, layer: LayerPosition)
[src]
Brings the given view to the front of the stack.
pub fn move_to_back(&mut self, layer: LayerPosition)
[src]
Pushes the given view to the back of the stack.
pub fn reposition_layer(&mut self, layer: LayerPosition, position: Position)
[src]
Moves a layer to a new position on the screen.
Has no effect on fullscreen layers Has no effect if layer is not found
pub fn draw_bg(&self, printer: &Printer)
[src]
Background drawing Drawing functions are split into forground and background to ease inserting layers under the stackview but above it's background you probably just want to call draw()
pub fn draw_fg(&self, printer: &Printer)
[src]
Forground drawing Drawing functions are split into forground and background to ease inserting layers under the stackview but above it's background you probably just want to call draw()
Trait Implementations
impl Default for StackView
[src]
impl View for StackView
[src]
fn draw(&self, printer: &Printer)
[src]
Draws the view with the given printer (includes bounds) and focus.
fn on_event(&mut self, event: Event) -> EventResult
[src]
Called when a key was pressed. Read more
fn layout(&mut self, size: Vec2)
[src]
Called once the size for this view has been decided, Read more
fn required_size(&mut self, size: Vec2) -> Vec2
[src]
Returns the minimum size the view requires with the given restrictions. Read more
fn take_focus(&mut self, source: Direction) -> bool
[src]
This view is offered focus. Will it take it? Read more
fn call_on_any<'a>(
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
[src]
&mut self,
selector: &Selector,
callback: Box<FnMut(&mut Any) + 'a>
)
Runs a closure on the view identified by the given selector. Read more
fn focus_view(&mut self, selector: &Selector) -> Result<(), ()>
[src]
Moves the focus to the view identified by the given selector. Read more
fn needs_relayout(&self) -> bool
[src]
Returns true
if the view content changed since last layout phase. Read more