Struct cursive_core::view::Margins
source · Expand description
Four values representing each direction.
Fields§
§left: usize
Left margin
right: usize
Right margin
top: usize
Top margin
bottom: usize
Bottom margin
Implementations§
source§impl Margins
impl Margins
sourcepub fn lrtb(left: usize, right: usize, top: usize, bottom: usize) -> Self
pub fn lrtb(left: usize, right: usize, top: usize, bottom: usize) -> Self
Creates a new Margins
object from the Left, Right, Top, Bottom fields.
sourcepub fn ltrb(left_top: Vec2, right_bottom: Vec2) -> Self
pub fn ltrb(left_top: Vec2, right_bottom: Vec2) -> Self
Creates a new Margins
object from the Left, Top, Right, Bottom fields.
sourcepub fn trbl(top: usize, right: usize, bottom: usize, left: usize) -> Self
pub fn trbl(top: usize, right: usize, bottom: usize, left: usize) -> Self
Creates a new Margins
object from the Top, Right, Bottom, Left fields.
sourcepub fn lr(left: usize, right: usize) -> Self
pub fn lr(left: usize, right: usize) -> Self
Creates a new Margins
object from the Left and Right fields.
Top and Bottom will be 0.
sourcepub fn tb(top: usize, bottom: usize) -> Self
pub fn tb(top: usize, bottom: usize) -> Self
Creates a new Margins
object from the Top and Bottom fields.
Left and Right will be 0.
sourcepub fn horizontal(&self) -> usize
pub fn horizontal(&self) -> usize
Returns left + right.