divider: Make the size flexible (#397)

This commit is contained in:
Floyd Wang 2024-11-06 17:45:38 +08:00 committed by GitHub
parent 3508453b11
commit 8c3997d795
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,7 +16,7 @@ pub struct Divider {
impl Divider {
pub fn vertical() -> Self {
Self {
base: div(),
base: div().h_full(),
axis: Axis::Vertical,
label: None,
}
@ -24,7 +24,7 @@ impl Divider {
pub fn horizontal() -> Self {
Self {
base: div(),
base: div().w_full(),
axis: Axis::Horizontal,
label: None,
}
@ -51,10 +51,6 @@ impl RenderOnce for Divider {
.flex_shrink_0()
.items_center()
.justify_center()
.map(|this| match self.axis {
Axis::Vertical => this.h_full(),
Axis::Horizontal => this.w_full(),
})
.child(
div()
.absolute()