Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

component_preview: Pin the filter input at the top (#43636)

Floyd Wangf10afd105921
diff --git a/crates/zed/src/zed/component_preview.rs b/crates/zed/src/zed/component_preview.rs
index c231836aaa9..14a46d8882d 100644
--- a/crates/zed/src/zed/component_preview.rs
+++ b/crates/zed/src/zed/component_preview.rs
@@ -653,10 +653,8 @@ impl Render for ComponentPreview {
)
.child(
v_flex()
- .id("content-area")
.flex_1()
.size_full()
- .overflow_y_scroll()
.child(
div()
.p_2()
@@ -665,14 +663,18 @@ impl Render for ComponentPreview {
.border_color(cx.theme().colors().border)
.child(self.filter_editor.clone()),
)
- .child(match active_page {
- PreviewPage::AllComponents => {
- self.render_all_components(cx).into_any_element()
- }
- PreviewPage::Component(id) => self
- .render_component_page(&id, window, cx)
- .into_any_element(),
- }),
+ .child(
+ div().id("content-area").flex_1().overflow_y_scroll().child(
+ match active_page {
+ PreviewPage::AllComponents => {
+ self.render_all_components(cx).into_any_element()
+ }
+ PreviewPage::Component(id) => self
+ .render_component_page(&id, window, cx)
+ .into_any_element(),
+ },
+ ),
+ ),
)
}
}