pub struct ContainerBuilder<'a> { /* private fields */ }Expand description
Fluent builder for configuring containers before calling .col() or .row().
Obtain one via Context::container or Context::bordered. Chain the
configuration methods you need, then finalize with .col(|ui| { ... }) or
.row(|ui| { ... }).
§Example
use slt::{Border, Color};
ui.container()
.border(Border::Rounded)
.pad(1)
.grow(1)
.col(|ui| {
ui.text("inside a bordered, padded, growing column");
});Implementations§
Source§impl<'a> ContainerBuilder<'a>
impl<'a> ContainerBuilder<'a>
Sourcepub fn border_style(self, style: Style) -> Self
pub fn border_style(self, style: Style) -> Self
Set the style applied to the border characters.
Sourcepub fn min_w(self, value: u32) -> Self
pub fn min_w(self, value: u32) -> Self
Set the minimum width constraint. Shorthand for min_width.
Sourcepub fn max_w(self, value: u32) -> Self
pub fn max_w(self, value: u32) -> Self
Set the maximum width constraint. Shorthand for max_width.
Sourcepub fn min_h(self, value: u32) -> Self
pub fn min_h(self, value: u32) -> Self
Set the minimum height constraint. Shorthand for min_height.
Sourcepub fn max_h(self, value: u32) -> Self
pub fn max_h(self, value: u32) -> Self
Set the maximum height constraint. Shorthand for max_height.
Sourcepub fn min_height(self, value: u32) -> Self
pub fn min_height(self, value: u32) -> Self
Set the minimum height constraint in rows.
Sourcepub fn max_height(self, value: u32) -> Self
pub fn max_height(self, value: u32) -> Self
Set the maximum height constraint in rows.
Sourcepub fn constraints(self, constraints: Constraints) -> Self
pub fn constraints(self, constraints: Constraints) -> Self
Set all size constraints at once using a Constraints value.
Sourcepub fn grow(self, grow: u16) -> Self
pub fn grow(self, grow: u16) -> Self
Set the flex-grow factor. 1 means the container expands to fill available space.
Sourcepub fn center(self) -> Self
pub fn center(self) -> Self
Center children on the cross axis. Shorthand for .align(Align::Center).
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
Set a plain-text title rendered in the top border.
Sourcepub fn title_styled(self, title: impl Into<String>, style: Style) -> Self
pub fn title_styled(self, title: impl Into<String>, style: Style) -> Self
Set a styled title rendered in the top border.
Sourcepub fn scroll_offset(self, offset: u32) -> Self
pub fn scroll_offset(self, offset: u32) -> Self
Set the vertical scroll offset in rows. Used internally by Context::scrollable.