From 4310b0b8deed20bc27808897a744072027a971b2 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 15 Feb 2024 22:26:49 -0500 Subject: [PATCH] Replace `full` with `size_full` (#7888) This PR removes the `full` style method and replaces it with `size_full`, as the two do the same thing. This is the generated code for `size_full`: ```rs #[doc = "Sets the width and height of the element.\n\n100%"] fn size_full(mut self) -> Self { let style = self.style(); style.size.width = Some((gpui::relative(1.)).into()); style.size.height = Some((gpui::relative(1.)).into()); self } ``` Release Notes: - N/A --- crates/collab_ui/src/chat_panel.rs | 6 +++--- crates/collab_ui/src/collab_panel.rs | 2 +- crates/gpui/src/styled.rs | 7 ------- crates/markdown_preview/src/markdown_preview_view.rs | 4 ++-- crates/welcome/src/welcome.rs | 2 +- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/crates/collab_ui/src/chat_panel.rs b/crates/collab_ui/src/chat_panel.rs index 999f02f2e074224aac0d42cbc56ab343bdc8d8da..abe345db6de4f25212027873f7f75944bf16a3da 100644 --- a/crates/collab_ui/src/chat_panel.rs +++ b/crates/collab_ui/src/chat_panel.rs @@ -733,7 +733,7 @@ impl Render for ChatPanel { v_flex() .key_context("ChatPanel") .track_focus(&self.focus_handle) - .full() + .size_full() .on_action(cx.listener(Self::send)) .child( h_flex().z_index(1).child( @@ -755,11 +755,11 @@ impl Render for ChatPanel { ) .child(div().flex_grow().px_2().map(|this| { if self.active_chat.is_some() { - this.child(list(self.message_list.clone()).full()) + this.child(list(self.message_list.clone()).size_full()) } else { this.child( div() - .full() + .size_full() .p_4() .child( Label::new("Select a channel to chat in.") diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index a010abdbcb08cafdd8d44ec73b4a91022bf5e391..d84fa78d4f73a0d126f62b34bc44293cb36d23c2 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -2036,7 +2036,7 @@ impl CollabPanel { fn render_signed_in(&mut self, cx: &mut ViewContext) -> Div { v_flex() .size_full() - .child(list(self.list_state.clone()).full()) + .child(list(self.list_state.clone()).size_full()) .child( v_flex() .child(div().mx_2().border_primary(cx).border_t()) diff --git a/crates/gpui/src/styled.rs b/crates/gpui/src/styled.rs index 6debf743546cff38aa9c819d7f46b7070d442488..d4014ffc2fbe4204e14b13fb7ad0d4c1486bc053 100644 --- a/crates/gpui/src/styled.rs +++ b/crates/gpui/src/styled.rs @@ -21,13 +21,6 @@ pub trait Styled: Sized { self } - /// Sets the size of the element to sthe full width and height. - fn full(mut self) -> Self { - self.style().size.width = Some(relative(1.).into()); - self.style().size.height = Some(relative(1.).into()); - self - } - /// Sets the position of the element to `relative`. /// [Docs](https://tailwindcss.com/docs/position) fn relative(mut self) -> Self { diff --git a/crates/markdown_preview/src/markdown_preview_view.rs b/crates/markdown_preview/src/markdown_preview_view.rs index f22a997e49833a62a6432c1b1a65a1427e608faf..fad1a3f0e007a8cbf7d6ab656eaf599ce56bfc34 100644 --- a/crates/markdown_preview/src/markdown_preview_view.rs +++ b/crates/markdown_preview/src/markdown_preview_view.rs @@ -209,13 +209,13 @@ impl Render for MarkdownPreviewView { .id("MarkdownPreview") .key_context("MarkdownPreview") .track_focus(&self.focus_handle) - .full() + .size_full() .bg(cx.theme().colors().editor_background) .p_4() .child( div() .flex_grow() - .map(|this| this.child(list(self.list_state.clone()).full())), + .map(|this| this.child(list(self.list_state.clone()).size_full())), ) } } diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs index 61581d5b6f57531e9c51556fbba5525ea85cd92d..aafbd4dbe7e1171df33193339ccd6a4c142298c4 100644 --- a/crates/welcome/src/welcome.rs +++ b/crates/welcome/src/welcome.rs @@ -61,7 +61,7 @@ pub struct WelcomePage { impl Render for WelcomePage { fn render(&mut self, cx: &mut gpui::ViewContext) -> impl IntoElement { h_flex() - .full() + .size_full() .bg(cx.theme().colors().editor_background) .track_focus(&self.focus_handle) .child(