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:
parent
db0455beb0
commit
7ac055627e
1 changed files with 31 additions and 31 deletions
|
@ -42,37 +42,6 @@ pub struct ExtensionsPage {
|
||||||
extension_fetch_task: Option<Task<()>>,
|
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 {
|
impl ExtensionsPage {
|
||||||
pub fn new(workspace: &Workspace, cx: &mut ViewContext<Workspace>) -> View<Self> {
|
pub fn new(workspace: &Workspace, cx: &mut ViewContext<Workspace>) -> View<Self> {
|
||||||
let extensions_panel = cx.new_view(|cx: &mut ViewContext<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 EventEmitter<ItemEvent> for ExtensionsPage {}
|
||||||
|
|
||||||
impl FocusableView for ExtensionsPage {
|
impl FocusableView for ExtensionsPage {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue