From 296a2b8e5d736ab3e3f0045e5b88882f43e17791 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 18 Oct 2023 09:39:23 +0200 Subject: [PATCH] Rename `fill` to `bg` --- crates/gpui3/src/style.rs | 6 +-- crates/gpui3/src/styled.rs | 4 +- crates/storybook2/src/collab_panel.rs | 12 ++--- crates/storybook2/src/stories/text.rs | 2 +- crates/storybook2/src/stories/z_index.rs | 6 +-- crates/storybook2/src/workspace.rs | 52 ++++++++++----------- crates/ui2/src/components/breadcrumb.rs | 2 +- crates/ui2/src/components/buffer.rs | 12 +++-- crates/ui2/src/components/buffer_search.rs | 2 +- crates/ui2/src/components/collab_panel.rs | 16 +++---- crates/ui2/src/components/context_menu.rs | 8 +++- crates/ui2/src/components/icon_button.rs | 4 +- crates/ui2/src/components/keybinding.rs | 8 +++- crates/ui2/src/components/list.rs | 10 ++-- crates/ui2/src/components/multi_buffer.rs | 2 +- crates/ui2/src/components/palette.rs | 6 +-- crates/ui2/src/components/panel.rs | 6 +-- crates/ui2/src/components/panes.rs | 6 +-- crates/ui2/src/components/player_stack.rs | 14 +++--- crates/ui2/src/components/project_panel.rs | 2 +- crates/ui2/src/components/status_bar.rs | 2 +- crates/ui2/src/components/tab.rs | 8 +++- crates/ui2/src/components/tab_bar.rs | 8 +++- crates/ui2/src/components/terminal.rs | 2 +- crates/ui2/src/components/title_bar.rs | 2 +- crates/ui2/src/components/toast.rs | 2 +- crates/ui2/src/components/toolbar.rs | 2 +- crates/ui2/src/components/traffic_lights.rs | 8 +++- crates/ui2/src/components/workspace.rs | 2 +- crates/ui2/src/elements/avatar.rs | 8 +++- crates/ui2/src/elements/button.rs | 2 +- crates/ui2/src/elements/input.rs | 4 +- crates/ui2/src/elements/label.rs | 8 +++- crates/ui2/src/elements/tool_divider.rs | 2 +- crates/ui2/src/story.rs | 2 +- 35 files changed, 136 insertions(+), 106 deletions(-) diff --git a/crates/gpui3/src/style.rs b/crates/gpui3/src/style.rs index eb2330fc16cd3c50ad02bc3dc19bb4f9b1f140fe..054d35cc4fefbf3e207ad1807cae460c8a2c3000 100644 --- a/crates/gpui3/src/style.rs +++ b/crates/gpui3/src/style.rs @@ -83,7 +83,7 @@ pub struct Style { pub flex_shrink: f32, /// The fill color of this element - pub fill: Option, + pub background: Option, /// The border color of this element pub border_color: Option, @@ -263,7 +263,7 @@ impl Style { ); }); - let background_color = self.fill.as_ref().and_then(Fill::color); + let background_color = self.background.as_ref().and_then(Fill::color); if background_color.is_some() || self.is_border_visible() { cx.stack(1, |cx| { cx.paint_quad( @@ -314,7 +314,7 @@ impl Default for Style { flex_grow: 0.0, flex_shrink: 1.0, flex_basis: Length::Auto, - fill: None, + background: None, border_color: None, corner_radii: Corners::default(), box_shadow: Default::default(), diff --git a/crates/gpui3/src/styled.rs b/crates/gpui3/src/styled.rs index 4dc9e4ecb71f6b89fadf3fb036f08448e62bf4c2..6fb6010152b21dd2a0f8047ec4c1d58560c1cd4f 100644 --- a/crates/gpui3/src/styled.rs +++ b/crates/gpui3/src/styled.rs @@ -178,12 +178,12 @@ pub trait Styled { self } - fn fill(mut self, fill: F) -> Self + fn bg(mut self, fill: F) -> Self where F: Into, Self: Sized, { - self.style().fill = Some(fill.into()); + self.style().background = Some(fill.into()); self } diff --git a/crates/storybook2/src/collab_panel.rs b/crates/storybook2/src/collab_panel.rs index bc21dafd4714ccb129c2b81f4a4480f92d1c2981..1202d5ccd704645ba9003a501ef736602b178626 100644 --- a/crates/storybook2/src/collab_panel.rs +++ b/crates/storybook2/src/collab_panel.rs @@ -34,7 +34,7 @@ impl CollabPanel { .text_color(theme.middle.base.default.foreground) .border_color(theme.middle.base.default.border) .border() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .child( div() .w_full() @@ -132,7 +132,7 @@ impl CollabPanel { .flex() .justify_between() .items_center() - .active(|style| style.fill(theme.highest.accent.default.background)) + .active(|style| style.bg(theme.highest.accent.default.background)) .child(div().flex().gap_1().text_sm().child(label)) .child( div().flex().h_full().gap_1().items_center().child( @@ -177,14 +177,14 @@ impl CollabPanel { // .uri(avatar_uri) .size_3p5() .rounded_full() - .fill(theme.middle.positive.default.foreground) + .bg(theme.middle.positive.default.foreground) .shadow() .group_hover("", |style| { - style.fill(theme.middle.negative.default.foreground) + style.bg(theme.middle.negative.default.foreground) }) - .hover(|style| style.fill(theme.middle.warning.default.foreground)) + .hover(|style| style.bg(theme.middle.warning.default.foreground)) .group_active("", |style| { - style.fill(theme.middle.accent.default.foreground) + style.bg(theme.middle.accent.default.foreground) }), ) .child(label), diff --git a/crates/storybook2/src/stories/text.rs b/crates/storybook2/src/stories/text.rs index 1f461ed569d137e15f5b567147c81d02277c9ad4..ebbcbc14469af9099fa805349994d4c9a64d58d2 100644 --- a/crates/storybook2/src/stories/text.rs +++ b/crates/storybook2/src/stories/text.rs @@ -9,7 +9,7 @@ impl TextStory { view(cx.entity(|cx| ()), |_, cx| { div() .size_full() - .fill(white()) + .bg(white()) .child(concat!( "The quick brown fox jumps over the lazy dog. ", "Meanwhile, the lazy dog decided it was time for a change. ", diff --git a/crates/storybook2/src/stories/z_index.rs b/crates/storybook2/src/stories/z_index.rs index fda3cf5d2802de05c42816b1c21c6173eb9394ab..deb6560eac5cac209f19567ae1218233882200c5 100644 --- a/crates/storybook2/src/stories/z_index.rs +++ b/crates/storybook2/src/stories/z_index.rs @@ -69,7 +69,7 @@ trait Styles: Styled + Sized { } fn blue(self) -> Self { - self.fill(rgb::(0xe5e8fc)) + self.bg(rgb::(0xe5e8fc)) .border_5() .border_color(rgb::(0x112382)) // HACK: Simulate `line-height: 55px`. @@ -79,7 +79,7 @@ trait Styles: Styled + Sized { } fn red(self) -> Self { - self.fill(rgb::(0xfce5e7)) + self.bg(rgb::(0xfce5e7)) .border_5() .border_color(rgb::(0xe3a1a7)) // HACK: Simulate `text-align: center`. @@ -115,7 +115,7 @@ impl ZIndexExample { .left(px(15.)) .w(px(180.)) .h(px(230.)) - .fill(rgb::(0xfcfbe5)) + .bg(rgb::(0xfcfbe5)) .text_color(rgb::(0x000000)) .border_5() .border_color(rgb::(0xe3e0a1)) diff --git a/crates/storybook2/src/workspace.rs b/crates/storybook2/src/workspace.rs index 610d80de0737ab23428d6c962456c2bc0eb39f2d..0919b50fc1e9bc7a4a02d921a4b31d0328b3e417 100644 --- a/crates/storybook2/src/workspace.rs +++ b/crates/storybook2/src/workspace.rs @@ -34,18 +34,18 @@ impl Workspace { .w_full() .h_5() .mt_10() - .fill(theme.middle.warning.default.foreground) + .bg(theme.middle.warning.default.foreground) .flex() .flex_row() .justify_center() .child( div() .size_5() - .fill(theme.middle.negative.default.foreground) + .bg(theme.middle.negative.default.foreground) .group_hover("", |style| { - style.fill(theme.middle.positive.default.foreground) + style.bg(theme.middle.positive.default.foreground) }) - .hover(|style| style.fill(theme.middle.variant.default.foreground)), + .hover(|style| style.bg(theme.middle.variant.default.foreground)), ), ) } @@ -63,7 +63,7 @@ impl Workspace { .justify_start() .items_start() .text_color(theme.lowest.base.default.foreground) - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .child(titlebar(cx)) .child( div() @@ -91,7 +91,7 @@ pub fn titlebar(cx: &mut ViewContext) -> impl Eleme .justify_between() .w_full() .h_8() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child(this.left_group(cx)) .child(this.right_group(cx)) } @@ -108,7 +108,7 @@ impl Titlebar { .justify_between() .w_full() .h_8() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child(self.left_group(cx)) .child(self.right_group(cx)) } @@ -131,25 +131,25 @@ impl Titlebar { .items_center() .gap_2() .child( - div() - .w_3() - .h_3() - .rounded_full() - .fill(theme.lowest.positive.default.foreground), + div().w_3().h_3().rounded_full().bg(theme + .lowest + .positive + .default + .foreground), ) .child( - div() - .w_3() - .h_3() - .rounded_full() - .fill(theme.lowest.warning.default.foreground), + div().w_3().h_3().rounded_full().bg(theme + .lowest + .warning + .default + .foreground), ) .child( - div() - .w_3() - .h_3() - .rounded_full() - .fill(theme.lowest.negative.default.foreground), + div().w_3().h_3().rounded_full().bg(theme + .lowest + .negative + .default + .foreground), ), ) // === Project Info === // @@ -220,7 +220,7 @@ impl Titlebar { ), ), ) - .child(div().w_px().h_3().fill(theme.lowest.base.default.border)) + .child(div().w_px().h_3().bg(theme.lowest.base.default.border)) // === Comms === // .child( div().child( @@ -290,7 +290,7 @@ impl Titlebar { ), ), ) - .child(div().w_px().h_3().fill(theme.lowest.base.default.border)) + .child(div().w_px().h_3().bg(theme.lowest.base.default.border)) // User Group .child( div().child( @@ -311,7 +311,7 @@ impl Titlebar { .uri("https://avatars.githubusercontent.com/u/1714999?v=4") .size_4() .rounded_md() - .fill(theme.middle.on.default.foreground), + .bg(theme.middle.on.default.foreground), ) .child( svg() @@ -341,7 +341,7 @@ mod statusbar { .justify_between() .w_full() .h_8() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) // .child(left_group(cx)) // .child(right_group(cx)) } diff --git a/crates/ui2/src/components/breadcrumb.rs b/crates/ui2/src/components/breadcrumb.rs index 58a9f7675985a4fad8c9a6e9ea4f915aca932039..b0c706f9abac46a6a19929828c44412e9d51b387 100644 --- a/crates/ui2/src/components/breadcrumb.rs +++ b/crates/ui2/src/components/breadcrumb.rs @@ -47,7 +47,7 @@ impl Breadcrumb { .text_sm() .text_color(theme.middle.base.default.foreground) .rounded_md() - .hover(|style| style.fill(theme.highest.base.hovered.background)) + .hover(|style| style.bg(theme.highest.base.hovered.background)) .child(self.path.clone().to_str().unwrap().to_string()) .child(if !self.symbols.is_empty() { self.render_separator(&theme) diff --git a/crates/ui2/src/components/buffer.rs b/crates/ui2/src/components/buffer.rs index f01726f086c2a3b1e67651d5e058dd9112828144..7a775327f9b67e3732c4d285a0e74a735e74f68c 100644 --- a/crates/ui2/src/components/buffer.rs +++ b/crates/ui2/src/components/buffer.rs @@ -179,7 +179,7 @@ impl Buffer { }; h_stack() - .fill(line_background) + .bg(line_background) .w_full() .gap_2() .px_1() @@ -201,7 +201,7 @@ impl Buffer { ), ) }) - .child(div().mx_0p5().w_1().h_full().fill(row.status.hsla(cx))) + .child(div().mx_0p5().w_1().h_full().bg(row.status.hsla(cx))) .children(row.line.map(|line| { div() .flex() @@ -232,7 +232,7 @@ impl Buffer { .flex_1() .w_full() .h_full() - .fill(theme.highest.base.default.background) + .bg(theme.highest.base.default.background) .children(rows) } } @@ -263,7 +263,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { let theme = theme(cx); Story::container(cx) diff --git a/crates/ui2/src/components/buffer_search.rs b/crates/ui2/src/components/buffer_search.rs index a0c60fd0abe62d53134707087d5d7e1068bab6dd..ddc18bdc77d149900a4996f88a7ba121601d9b76 100644 --- a/crates/ui2/src/components/buffer_search.rs +++ b/crates/ui2/src/components/buffer_search.rs @@ -30,7 +30,7 @@ impl BufferSearch { let theme = theme(cx); h_stack() - .fill(theme.highest.base.default.background) + .bg(theme.highest.base.default.background) .p_2() .child( h_stack() diff --git a/crates/ui2/src/components/collab_panel.rs b/crates/ui2/src/components/collab_panel.rs index bbf1a71f5b586bcb81d3ee448fd273a52efa8a75..55733ed8d360d332f222bbaea7815289b42d78a7 100644 --- a/crates/ui2/src/components/collab_panel.rs +++ b/crates/ui2/src/components/collab_panel.rs @@ -29,14 +29,14 @@ impl CollabPanel { v_stack() .h_full() - .fill(color.surface) + .bg(color.surface) .child( v_stack() .w_full() .overflow_y_scroll(self.scroll_state.clone()) .child( div() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .pb_1() .border_color(theme.lowest.base.default.border) .border_b() @@ -137,7 +137,7 @@ impl CollabPanel { .px_2() .flex() .items_center() - .hover(|style| style.fill(theme.lowest.variant.hovered.background)) + .hover(|style| style.bg(theme.lowest.variant.hovered.background)) // .active(|style| style.fill(theme.lowest.variant.pressed.background)) .child( div() @@ -146,11 +146,11 @@ impl CollabPanel { .gap_1() .text_sm() .child( - img() - .uri(avatar_uri) - .size_3p5() - .rounded_full() - .fill(theme.middle.positive.default.foreground), + img().uri(avatar_uri).size_3p5().rounded_full().bg(theme + .middle + .positive + .default + .foreground), ) .child(label.into()), ) diff --git a/crates/ui2/src/components/context_menu.rs b/crates/ui2/src/components/context_menu.rs index ec9e821cbbda4b5273005ca9c15978b297deafb1..cd7f70576b033f2318b7dd55177080cf9f3c0852 100644 --- a/crates/ui2/src/components/context_menu.rs +++ b/crates/ui2/src/components/context_menu.rs @@ -48,7 +48,7 @@ impl ContextMenu { v_stack() .flex() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .border() .border_color(theme.lowest.base.default.border) .child( @@ -87,7 +87,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, ContextMenu>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/components/icon_button.rs b/crates/ui2/src/components/icon_button.rs index f7562cbeec0991c3377c17b43519fdc0e6c3d703..a75b9ff5ffd45fe15309575036ac48f5c22cc37b 100644 --- a/crates/ui2/src/components/icon_button.rs +++ b/crates/ui2/src/components/icon_button.rs @@ -76,7 +76,7 @@ impl IconButton { let mut div = div(); if self.variant == ButtonVariant::Filled { - div = div.fill(theme.highest.on.default.background); + div = div.bg(theme.highest.on.default.background); } if let Some(click_handler) = self.handlers.click.clone() { @@ -91,7 +91,7 @@ impl IconButton { .items_center() .justify_center() .rounded_md() - .hover(|style| style.fill(theme.highest.base.hovered.background)) + .hover(|style| style.bg(theme.highest.base.hovered.background)) // .active() // .fill(theme.highest.base.pressed.background) .child(IconElement::new(self.icon).color(icon_color)) diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 40718b733302af4f4fe5dfcb31c2e28c9527f23a..a4c3df439564874ad10a553664bc6adeff78879d 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -81,7 +81,7 @@ impl Key { .rounded_md() .text_sm() .text_color(theme.lowest.on.default.foreground) - .fill(theme.lowest.on.default.background) + .bg(theme.lowest.on.default.background) .child(self.key.clone()) } } @@ -189,7 +189,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { let all_modifier_permutations = ModifierKey::iter().permutations(2); Story::container(cx) diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs index d02740aa55a65adedcc7db96e25333e14a3dec58..d4aba32f36544ea30cd91d8b9a532033106c4dcd 100644 --- a/crates/ui2/src/components/list.rs +++ b/crates/ui2/src/components/list.rs @@ -106,7 +106,7 @@ impl ListHeader { h_stack() .flex_1() .w_full() - .fill(color.surface) + .bg(color.surface) .when(self.state == InteractionState::Focused, |this| { this.border().border_color(color.border_focused) }) @@ -398,7 +398,7 @@ impl ListEntry { div() .relative() .group("") - .fill(color.surface) + .bg(color.surface) .when(self.state == InteractionState::Focused, |this| { this.border().border_color(color.border_focused) }) @@ -412,11 +412,11 @@ impl ListEntry { .h_full() .flex() .justify_center() - .group_hover("", |style| style.fill(color.border_focused)) + .group_hover("", |style| style.bg(color.border_focused)) .child( h_stack() .child(div().w_px().h_full()) - .child(div().w_px().h_full().fill(color.border)), + .child(div().w_px().h_full().bg(color.border)), ) })) .flex() @@ -445,7 +445,7 @@ impl ListSeparator { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let color = ThemeColor::new(cx); - div().h_px().w_full().fill(color.border) + div().h_px().w_full().bg(color.border) } } diff --git a/crates/ui2/src/components/multi_buffer.rs b/crates/ui2/src/components/multi_buffer.rs index 31e6faa3bcf142f5757a5e67a7fde30297dbce2e..d786a2ebb04903ceaa7b9ce02fc8f860a1e94c3c 100644 --- a/crates/ui2/src/components/multi_buffer.rs +++ b/crates/ui2/src/components/multi_buffer.rs @@ -32,7 +32,7 @@ impl MultiBuffer { .items_center() .justify_between() .p_4() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child(Label::new("main.rs").size(LabelSize::Small)) .child(IconButton::new(Icon::ArrowUpRight)), ) diff --git a/crates/ui2/src/components/palette.rs b/crates/ui2/src/components/palette.rs index 08c8c93e98a38282cbaefd8eb07d9d325b1a0bf2..8cfb69991685aba6424d5974539d73a108976e2f 100644 --- a/crates/ui2/src/components/palette.rs +++ b/crates/ui2/src/components/palette.rs @@ -53,7 +53,7 @@ impl Palette { v_stack() .w_96() .rounded_lg() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .border() .border_color(theme.lowest.base.default.border) .child( @@ -64,7 +64,7 @@ impl Palette { Label::new(self.input_placeholder).color(LabelColor::Placeholder), ), )) - .child(div().h_px().w_full().fill(theme.lowest.base.default.border)) + .child(div().h_px().w_full().bg(theme.lowest.base.default.border)) .child( v_stack() .py_0p5() @@ -89,7 +89,7 @@ impl Palette { .px_2() .py_0p5() .rounded_lg() - .hover(|style| style.fill(theme.lowest.base.hovered.background)) + .hover(|style| style.bg(theme.lowest.base.hovered.background)) // .active() // .fill(theme.lowest.base.pressed.background) .child(item.clone()) diff --git a/crates/ui2/src/components/panel.rs b/crates/ui2/src/components/panel.rs index 524ae88f75c87a71a319c08af42763569b092821..7aeb31aa37a54cfb8c38b4bd1c8339633972d620 100644 --- a/crates/ui2/src/components/panel.rs +++ b/crates/ui2/src/components/panel.rs @@ -109,7 +109,7 @@ impl Panel { .h_full() // .w(current_width) .w_64() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .border_r() .border_color(theme.middle.base.default.border); } @@ -119,7 +119,7 @@ impl Panel { .h_full() // .w(current_width) .w_64() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .border_l() .border_color(theme.middle.base.default.border); } @@ -129,7 +129,7 @@ impl Panel { .w_full() // .h(current_width) .h_64() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .border_t() .border_color(theme.middle.base.default.border); } diff --git a/crates/ui2/src/components/panes.rs b/crates/ui2/src/components/panes.rs index 697b18f87470615f42decb07011b900637bcb9fa..96c0bb86ce266b8004b4dfbe26ebc42185bb12ba 100644 --- a/crates/ui2/src/components/panes.rs +++ b/crates/ui2/src/components/panes.rs @@ -48,7 +48,7 @@ impl Pane { div() .flex() .flex_initial() - .fill(self.fill) + .bg(self.fill) .w(self.size.width) .h(self.size.height) .overflow_y_scroll(self.scroll_state.clone()) @@ -99,7 +99,7 @@ impl PaneGroup { .gap_px() .w_full() .h_full() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .children(self.panes.iter_mut().map(|pane| pane.render(view, cx))); if self.split_direction == SplitDirection::Horizontal { @@ -116,7 +116,7 @@ impl PaneGroup { .gap_px() .w_full() .h_full() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .children(self.groups.iter_mut().map(|group| group.render(view, cx))); if self.split_direction == SplitDirection::Horizontal { diff --git a/crates/ui2/src/components/player_stack.rs b/crates/ui2/src/components/player_stack.rs index d664c7c0c736b03fa0125ccd5fa4104459c9faf0..a5f76f4ab915d96c39c255120c6aa179ebdbe4c7 100644 --- a/crates/ui2/src/components/player_stack.rs +++ b/crates/ui2/src/components/player_stack.rs @@ -39,13 +39,11 @@ impl PlayerStack { .gap_px() .justify_center() .child( - div().flex().justify_center().w_full().child( - div() - .w_4() - .h_0p5() - .rounded_sm() - .fill(player.cursor_color(cx)), - ), + div() + .flex() + .justify_center() + .w_full() + .child(div().w_4().h_0p5().rounded_sm().bg(player.cursor_color(cx))), ) .child( div() @@ -55,7 +53,7 @@ impl PlayerStack { .h_6() .pl_1() .rounded_lg() - .fill(if followers.is_none() { + .bg(if followers.is_none() { system_color.transparent } else { player.selection_color(cx) diff --git a/crates/ui2/src/components/project_panel.rs b/crates/ui2/src/components/project_panel.rs index 66ec6fbf01742b0eed5cf47d37286431e8c6c573..4c4fbe9f293602bd4dfe8435837203ccee50df22 100644 --- a/crates/ui2/src/components/project_panel.rs +++ b/crates/ui2/src/components/project_panel.rs @@ -29,7 +29,7 @@ impl ProjectPanel { .flex_col() .w_full() .h_full() - .fill(color.surface) + .bg(color.surface) .child( div() .w_full() diff --git a/crates/ui2/src/components/status_bar.rs b/crates/ui2/src/components/status_bar.rs index ce6ce623a5d9aeea586a67f1813c8893e26e99ea..8a68cbf31bce704c0acf3269c1ddf43bb724767c 100644 --- a/crates/ui2/src/components/status_bar.rs +++ b/crates/ui2/src/components/status_bar.rs @@ -96,7 +96,7 @@ impl StatusBar { .items_center() .justify_between() .w_full() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child(self.left_tools(view, &theme)) .child(self.right_tools(view, &theme)) } diff --git a/crates/ui2/src/components/tab.rs b/crates/ui2/src/components/tab.rs index 7624b37272cf66343f92b8354b8a13e639efb1b1..7e8ad15daa69f4895dc5df691a550f92d869fc59 100644 --- a/crates/ui2/src/components/tab.rs +++ b/crates/ui2/src/components/tab.rs @@ -102,7 +102,7 @@ impl Tab { .flex() .items_center() .justify_center() - .fill(if self.current { + .bg(if self.current { theme.highest.base.default.background } else { theme.middle.base.default.background @@ -157,7 +157,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { let git_statuses = GitStatus::iter(); let fs_statuses = FileSystemStatus::iter(); diff --git a/crates/ui2/src/components/tab_bar.rs b/crates/ui2/src/components/tab_bar.rs index b5324243a477eb19d21cf92bb17e4ac318debef5..542bc695188ab9bfda68bde65bdca89268b8ba71 100644 --- a/crates/ui2/src/components/tab_bar.rs +++ b/crates/ui2/src/components/tab_bar.rs @@ -31,7 +31,7 @@ impl TabBar { div() .w_full() .flex() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) // Left Side .child( div() @@ -105,7 +105,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, TabBar>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/components/terminal.rs b/crates/ui2/src/components/terminal.rs index 1fe1ab410309828b75c09bbc66b2598f4be4db35..598fad5fa6bde16b7ce7f5935be1aba507af5b3e 100644 --- a/crates/ui2/src/components/terminal.rs +++ b/crates/ui2/src/components/terminal.rs @@ -32,7 +32,7 @@ impl Terminal { div() .w_full() .flex() - .fill(theme.middle.base.default.background) + .bg(theme.middle.base.default.background) .child( div().px_1().flex().flex_none().gap_2().child( div() diff --git a/crates/ui2/src/components/title_bar.rs b/crates/ui2/src/components/title_bar.rs index 6fe096cdb5b3fd9893e5a6a1058b5abc2f2c6065..06139144769e6ef5a0524d8b8d0ac414c01be803 100644 --- a/crates/ui2/src/components/title_bar.rs +++ b/crates/ui2/src/components/title_bar.rs @@ -108,7 +108,7 @@ impl TitleBar { .justify_between() .w_full() .h_8() - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child( div() .flex() diff --git a/crates/ui2/src/components/toast.rs b/crates/ui2/src/components/toast.rs index dfa59517d79b730e84d7721b02f8e629b90da663..1f19dc911ef935a9999adcf8c8ff57a372f308a9 100644 --- a/crates/ui2/src/components/toast.rs +++ b/crates/ui2/src/components/toast.rs @@ -56,7 +56,7 @@ impl Toast { .rounded_lg() .shadow_md() .overflow_hidden() - .fill(color.elevated_surface) + .bg(color.elevated_surface) .children(self.children.drain(..)) } } diff --git a/crates/ui2/src/components/toolbar.rs b/crates/ui2/src/components/toolbar.rs index 8f187c4f7169e7cd843d45958b64d33a2220d96e..0be752b3e3016384c890746360f8671b704b12c9 100644 --- a/crates/ui2/src/components/toolbar.rs +++ b/crates/ui2/src/components/toolbar.rs @@ -59,7 +59,7 @@ impl Toolbar { let theme = theme(cx); div() - .fill(theme.highest.base.default.background) + .bg(theme.highest.base.default.background) .p_2() .flex() .justify_between() diff --git a/crates/ui2/src/components/traffic_lights.rs b/crates/ui2/src/components/traffic_lights.rs index 753f9389c029f45ee576ff8afc86bf025be8e1c4..cacc82bc08b3abe5c01b3fdd909b8acb952f275e 100644 --- a/crates/ui2/src/components/traffic_lights.rs +++ b/crates/ui2/src/components/traffic_lights.rs @@ -37,7 +37,7 @@ impl TrafficLight { (false, _) => theme.lowest.base.active.background, }; - div().w_3().h_3().rounded_full().fill(fill) + div().w_3().h_3().rounded_full().bg(fill) } } @@ -104,7 +104,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, TrafficLights>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/components/workspace.rs b/crates/ui2/src/components/workspace.rs index c58f83596c8b5fdc99fdb887a40c10b927d332b4..b198861e9538f9cc46f8072df1325779ead434df 100644 --- a/crates/ui2/src/components/workspace.rs +++ b/crates/ui2/src/components/workspace.rs @@ -151,7 +151,7 @@ impl Workspace { .justify_start() .items_start() .text_color(theme.lowest.base.default.foreground) - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) .child(self.title_bar.clone()) .child( div() diff --git a/crates/ui2/src/elements/avatar.rs b/crates/ui2/src/elements/avatar.rs index eb541d35de3f8a59ad883904f36bd93435e3c5a9..fa86d5f7c4586bd84db2df602b8e387d37e66e94 100644 --- a/crates/ui2/src/elements/avatar.rs +++ b/crates/ui2/src/elements/avatar.rs @@ -39,7 +39,7 @@ impl Avatar { img.uri(self.src.clone()) .size_4() - .fill(theme.middle.warning.default.foreground) + .bg(theme.middle.warning.default.foreground) } } @@ -64,7 +64,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, Avatar>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/elements/button.rs b/crates/ui2/src/elements/button.rs index e1dac4466fd524432fa115e483f578de7d07abdd..e57057360c3c3d6bb01d0f694ce3f3ea53ab2381 100644 --- a/crates/ui2/src/elements/button.rs +++ b/crates/ui2/src/elements/button.rs @@ -162,7 +162,7 @@ impl Button { .rounded_md() .border() .border_color(border_color) - .fill(self.background_color(cx)); + .bg(self.background_color(cx)); match (self.icon, self.icon_position) { (Some(_), Some(IconPosition::Left)) => { diff --git a/crates/ui2/src/elements/input.rs b/crates/ui2/src/elements/input.rs index f80fdd9517c8b582dd15eb6f2244620ea29c761f..0323de7032de4739fd5d9e0a4858828906e4970e 100644 --- a/crates/ui2/src/elements/input.rs +++ b/crates/ui2/src/elements/input.rs @@ -87,11 +87,11 @@ impl Input { .px_2() .border() .border_color(border_color_default) - .fill(background_color_default) + .bg(background_color_default) .hover(|style| { style .border_color(border_color_hover) - .fill(background_color_active) + .bg(background_color_active) }) // .active(|a| .border_color(border_color_active)) .flex() diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rs index 46edeeadbee7b39aabbefeb289e7bb12de1f637a..edcc76665ad6ee19c669e35719fa55542e711fe8 100644 --- a/crates/ui2/src/elements/label.rs +++ b/crates/ui2/src/elements/label.rs @@ -141,7 +141,7 @@ impl Label { .my_auto() .w_full() .h_px() - .fill(LabelColor::Hidden.hsla(cx)), + .bg(LabelColor::Hidden.hsla(cx)), ) }) .children(runs.into_iter().map(|run| { @@ -185,7 +185,11 @@ mod stories { } } - fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { + fn render( + &mut self, + _view: &mut S, + cx: &mut ViewContext, + ) -> impl Element { Story::container(cx) .child(Story::title_for::<_, Label>(cx)) .child(Story::label(cx, "Default")) diff --git a/crates/ui2/src/elements/tool_divider.rs b/crates/ui2/src/elements/tool_divider.rs index 0569ac01d5545088b572d02ad5c4ab628f17f320..3b7392c3a2ce9a7f2705f65f2a82abbd952c2f27 100644 --- a/crates/ui2/src/elements/tool_divider.rs +++ b/crates/ui2/src/elements/tool_divider.rs @@ -18,6 +18,6 @@ impl ToolDivider { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let theme = theme(cx); - div().w_px().h_3().fill(theme.lowest.base.default.border) + div().w_px().h_3().bg(theme.lowest.base.default.border) } } diff --git a/crates/ui2/src/story.rs b/crates/ui2/src/story.rs index a6fac40425843afd025cb92c52cfc706f02f2223..4edc796d00a55f63d7b9e37f83bb0cd66c017bff 100644 --- a/crates/ui2/src/story.rs +++ b/crates/ui2/src/story.rs @@ -16,7 +16,7 @@ impl Story { .pt_2() .px_4() .font("Zed Mono Extended") - .fill(theme.lowest.base.default.background) + .bg(theme.lowest.base.default.background) } pub fn title(