[−][src]Trait cursive_aligned_view::Alignable
Use this trait to extend all cursive::view::View
instances to support
the align_...
methods.
This trait provides chainable constructors for the AlignedView
.
Usage Example
use cursive::Cursive; use cursive::view::Boxable; use cursive::views::{Panel, DummyView}; use cursive_aligned_view::Alignable; fn main() { let mut siv = Cursive::default(); let panel = Panel::new(DummyView) .title("Hello, world!") .fixed_width(20) .align_top_center(); // constructing `AlignedView` siv.add_fullscreen_layer(panel); // siv.run() }
Provided methods
fn align_top_left(self) -> AlignedView<Self>
Align a child view at the top-left of the parent.
fn align_top_center(self) -> AlignedView<Self>
Align a child view at the top-center of the parent.
fn align_top_right(self) -> AlignedView<Self>
Align a child view at the top-right of the parent.
fn align_center_left(self) -> AlignedView<Self>
Align a child view at the center-left of the parent.
fn align_center(self) -> AlignedView<Self>
Align a child view at the center of the parent.
fn align_center_right(self) -> AlignedView<Self>
Align a child view at the center-right of the parent.
fn align_bottom_left(self) -> AlignedView<Self>
Align a child view at the bottom-left of the parent.
fn align_bottom_center(self) -> AlignedView<Self>
Align a child view at the bottom-center of the parent.
fn align_bottom_right(self) -> AlignedView<Self>
Align a child view at the bottom-right of the parent.