story: Fix double border in ResizableStory.
This commit is contained in:
parent
c97cdd7b89
commit
7934e8af31
1 changed files with 44 additions and 36 deletions
|
|
@ -53,11 +53,9 @@ impl ResizableStory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn panel_box(content: impl Into<SharedString>, cx: &App) -> AnyElement {
|
fn panel_box(content: impl Into<SharedString>, _: &App) -> AnyElement {
|
||||||
div()
|
div()
|
||||||
.p_4()
|
.p_4()
|
||||||
.border_1()
|
|
||||||
.border_color(cx.theme().border)
|
|
||||||
.size_full()
|
.size_full()
|
||||||
.child(content.into())
|
.child(content.into())
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
|
|
@ -69,42 +67,52 @@ impl Render for ResizableStory {
|
||||||
.size_full()
|
.size_full()
|
||||||
.gap_6()
|
.gap_6()
|
||||||
.child(
|
.child(
|
||||||
div().h(px(800.)).child(
|
div()
|
||||||
v_resizable("resizable-1", self.state1.clone())
|
.h(px(600.))
|
||||||
.group(
|
.border_1()
|
||||||
h_resizable("resizable-1.1", self.state2.clone())
|
.border_color(cx.theme().border)
|
||||||
.size(px(150.))
|
.child(
|
||||||
.child(
|
v_resizable("resizable-1", self.state1.clone())
|
||||||
resizable_panel()
|
.group(
|
||||||
.size(px(150.))
|
h_resizable("resizable-1.1", self.state2.clone())
|
||||||
.size_range(px(120.)..px(300.))
|
.size(px(150.))
|
||||||
.child(panel_box("Left (120px .. 300px)", cx)),
|
.child(
|
||||||
)
|
resizable_panel()
|
||||||
.child(resizable_panel().child(panel_box("Center", cx)))
|
.size(px(150.))
|
||||||
.child(
|
.size_range(px(120.)..px(300.))
|
||||||
resizable_panel()
|
.child(panel_box("Left (120px .. 300px)", cx)),
|
||||||
.size(px(300.))
|
)
|
||||||
.child(panel_box("Right", cx)),
|
.child(resizable_panel().child(panel_box("Center", cx)))
|
||||||
),
|
.child(
|
||||||
)
|
resizable_panel()
|
||||||
.child(resizable_panel().child(panel_box("Center", cx)))
|
.size(px(300.))
|
||||||
.child(
|
.child(panel_box("Right", cx)),
|
||||||
resizable_panel()
|
),
|
||||||
.size(px(80.))
|
)
|
||||||
.size_range(px(80.)..Pixels::MAX)
|
.child(resizable_panel().child(panel_box("Center", cx)))
|
||||||
.child(panel_box("Bottom (80px .. 150px)", cx)),
|
.child(
|
||||||
),
|
resizable_panel()
|
||||||
),
|
.size(px(80.))
|
||||||
|
.size_range(px(80.)..Pixels::MAX)
|
||||||
|
.child(panel_box("Bottom (80px .. 150px)", cx)),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_resizable("resizable-3", self.state3.clone())
|
div()
|
||||||
|
.h(px(400.))
|
||||||
|
.border_1()
|
||||||
|
.border_color(cx.theme().border)
|
||||||
.child(
|
.child(
|
||||||
resizable_panel()
|
h_resizable("resizable-3", self.state3.clone())
|
||||||
.size(px(200.))
|
.child(
|
||||||
.size_range(px(200.)..px(400.))
|
resizable_panel()
|
||||||
.child(panel_box("Left 2", cx)),
|
.size(px(200.))
|
||||||
)
|
.size_range(px(200.)..px(400.))
|
||||||
.child(resizable_panel().child(panel_box("Right (Grow)", cx))),
|
.child(panel_box("Left 2", cx)),
|
||||||
|
)
|
||||||
|
.child(resizable_panel().child(panel_box("Right (Grow)", cx))),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue