Reorganize extensions_ui.rs (#7779)

This PR reorganizes `extensions_ui.rs` by moving the `Render` impl down
below the primary `ExtensionsPage` impl.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-02-14 11:44:51 -05:00 committed by GitHub
parent db0455beb0
commit 7ac055627e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -42,37 +42,6 @@ pub struct ExtensionsPage {
extension_fetch_task: Option<Task<()>>,
}
impl Render for ExtensionsPage {
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
h_flex()
.full()
.bg(cx.theme().colors().editor_background)
.child(
v_flex()
.full()
.p_4()
.child(
h_flex()
.w_full()
.child(Headline::new("Extensions").size(HeadlineSize::XLarge)),
)
.child(h_flex().w_56().my_4().child(self.render_search(cx)))
.child(
h_flex().flex_col().items_start().full().child(
uniform_list::<_, Div, _>(
cx.view().clone(),
"entries",
self.extensions_entries.len(),
Self::render_extensions,
)
.size_full()
.track_scroll(self.list.clone()),
),
),
)
}
}
impl ExtensionsPage {
pub fn new(workspace: &Workspace, cx: &mut ViewContext<Workspace>) -> View<Self> {
let extensions_panel = cx.new_view(|cx: &mut ViewContext<Self>| {
@ -366,6 +335,37 @@ impl ExtensionsPage {
}
}
impl Render for ExtensionsPage {
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl IntoElement {
h_flex()
.full()
.bg(cx.theme().colors().editor_background)
.child(
v_flex()
.full()
.p_4()
.child(
h_flex()
.w_full()
.child(Headline::new("Extensions").size(HeadlineSize::XLarge)),
)
.child(h_flex().w_56().my_4().child(self.render_search(cx)))
.child(
h_flex().flex_col().items_start().full().child(
uniform_list::<_, Div, _>(
cx.view().clone(),
"entries",
self.extensions_entries.len(),
Self::render_extensions,
)
.size_full()
.track_scroll(self.list.clone()),
),
),
)
}
}
impl EventEmitter<ItemEvent> for ExtensionsPage {}
impl FocusableView for ExtensionsPage {