divider: Make the size flexible (#397)
This commit is contained in:
parent
3508453b11
commit
8c3997d795
1 changed files with 2 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ pub struct Divider {
|
||||||
impl Divider {
|
impl Divider {
|
||||||
pub fn vertical() -> Self {
|
pub fn vertical() -> Self {
|
||||||
Self {
|
Self {
|
||||||
base: div(),
|
base: div().h_full(),
|
||||||
axis: Axis::Vertical,
|
axis: Axis::Vertical,
|
||||||
label: None,
|
label: None,
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ impl Divider {
|
||||||
|
|
||||||
pub fn horizontal() -> Self {
|
pub fn horizontal() -> Self {
|
||||||
Self {
|
Self {
|
||||||
base: div(),
|
base: div().w_full(),
|
||||||
axis: Axis::Horizontal,
|
axis: Axis::Horizontal,
|
||||||
label: None,
|
label: None,
|
||||||
}
|
}
|
||||||
|
|
@ -51,10 +51,6 @@ impl RenderOnce for Divider {
|
||||||
.flex_shrink_0()
|
.flex_shrink_0()
|
||||||
.items_center()
|
.items_center()
|
||||||
.justify_center()
|
.justify_center()
|
||||||
.map(|this| match self.axis {
|
|
||||||
Axis::Vertical => this.h_full(),
|
|
||||||
Axis::Horizontal => this.w_full(),
|
|
||||||
})
|
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.absolute()
|
.absolute()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue