pub struct Split { /* private fields */ }
Expand description
A container containing two other widgets, splitting the area either horizontally or vertically.
Implementations§
source§impl Split
impl Split
sourcepub fn columns(
child1: impl Widget + 'static,
child2: impl Widget + 'static
) -> Self
pub fn columns( child1: impl Widget + 'static, child2: impl Widget + 'static ) -> Self
Create a new split panel, with the horizontal axis split in two by a vertical bar. The children are laid out left and right.
sourcepub fn rows(
child1: impl Widget + 'static,
child2: impl Widget + 'static
) -> Self
pub fn rows( child1: impl Widget + 'static, child2: impl Widget + 'static ) -> Self
Create a new split panel, with the vertical axis split in two by a horizontal bar. The children are laid out up and down.
sourcepub fn split_point(self, split_point: f64) -> Self
pub fn split_point(self, split_point: f64) -> Self
Builder-style method to set the split point as a fraction of the split axis.
The value must be between 0.0
and 1.0
, inclusive.
The default split point is 0.5
.
sourcepub fn min_size(self, first: f64, second: f64) -> Self
pub fn min_size(self, first: f64, second: f64) -> Self
Builder-style method to set the minimum size for both sides of the split axis.
The value must be greater than or equal to 0.0
.
The value will be rounded up to the nearest integer.
sourcepub fn bar_size(self, bar_size: f64) -> Self
pub fn bar_size(self, bar_size: f64) -> Self
Builder-style method to set the size of the splitter bar.
The value must be positive or zero.
The value will be rounded up to the nearest integer.
The default splitter bar size is 6.0
.
sourcepub fn min_bar_area(self, min_bar_area: f64) -> Self
pub fn min_bar_area(self, min_bar_area: f64) -> Self
Builder-style method to set the minimum size of the splitter bar area.
The minimum splitter bar area defines the minimum size of the area where mouse hit detection is done for the splitter bar. The final area is either this or the splitter bar size, whichever is greater.
This can be useful when you want to use a very narrow visual splitter bar, but don’t want to sacrifice user experience by making it hard to click on.
The value must be positive or zero.
The value will be rounded up to the nearest integer.
The default minimum splitter bar area is 6.0
.