Rename fill
to bg
This commit is contained in:
parent
597a9f9548
commit
296a2b8e5d
35 changed files with 136 additions and 106 deletions
|
@ -47,7 +47,7 @@ impl<S: 'static + Send + Sync + Clone> Breadcrumb<S> {
|
|||
.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)
|
||||
|
|
|
@ -179,7 +179,7 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
};
|
||||
|
||||
h_stack()
|
||||
.fill(line_background)
|
||||
.bg(line_background)
|
||||
.w_full()
|
||||
.gap_2()
|
||||
.px_1()
|
||||
|
@ -201,7 +201,7 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
),
|
||||
)
|
||||
})
|
||||
.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<S: 'static + Send + Sync + Clone> Buffer<S> {
|
|||
.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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
let theme = theme(cx);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -29,14 +29,14 @@ impl<S: 'static + Send + Sync + Clone> CollabPanel<S> {
|
|||
|
||||
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<S: 'static + Send + Sync + Clone> CollabPanel<S> {
|
|||
.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<S: 'static + Send + Sync + Clone> CollabPanel<S> {
|
|||
.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()),
|
||||
)
|
||||
|
|
|
@ -48,7 +48,7 @@ impl<S: 'static + Send + Sync + Clone> ContextMenu<S> {
|
|||
|
||||
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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, ContextMenu<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -76,7 +76,7 @@ impl<S: 'static + Send + Sync> IconButton<S> {
|
|||
|
||||
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<S: 'static + Send + Sync> IconButton<S> {
|
|||
.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))
|
||||
|
|
|
@ -81,7 +81,7 @@ impl<S: 'static + Send + Sync> Key<S> {
|
|||
.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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
let all_modifier_permutations = ModifierKey::iter().permutations(2);
|
||||
|
||||
Story::container(cx)
|
||||
|
|
|
@ -106,7 +106,7 @@ impl<S: 'static + Send + Sync + Clone> ListHeader<S> {
|
|||
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<S: 'static + Send + Sync + Clone> ListEntry<S> {
|
|||
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<S: 'static + Send + Sync + Clone> ListEntry<S> {
|
|||
.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<S: 'static + Send + Sync> ListSeparator<S> {
|
|||
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
|
||||
let color = ThemeColor::new(cx);
|
||||
|
||||
div().h_px().w_full().fill(color.border)
|
||||
div().h_px().w_full().bg(color.border)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ impl<S: 'static + Send + Sync + Clone> MultiBuffer<S> {
|
|||
.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)),
|
||||
)
|
||||
|
|
|
@ -53,7 +53,7 @@ impl<S: 'static + Send + Sync + Clone> Palette<S> {
|
|||
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<S: 'static + Send + Sync + Clone> Palette<S> {
|
|||
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<S: 'static + Send + Sync + Clone> Palette<S> {
|
|||
.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())
|
||||
|
|
|
@ -109,7 +109,7 @@ impl<S: 'static + Send + Sync> Panel<S> {
|
|||
.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<S: 'static + Send + Sync> Panel<S> {
|
|||
.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<S: 'static + Send + Sync> Panel<S> {
|
|||
.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);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ impl<S: 'static + Send + Sync> Pane<S> {
|
|||
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<S: 'static + Send + Sync> PaneGroup<S> {
|
|||
.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<S: 'static + Send + Sync> PaneGroup<S> {
|
|||
.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 {
|
||||
|
|
|
@ -39,13 +39,11 @@ impl<S: 'static + Send + Sync> PlayerStack<S> {
|
|||
.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<S: 'static + Send + Sync> PlayerStack<S> {
|
|||
.h_6()
|
||||
.pl_1()
|
||||
.rounded_lg()
|
||||
.fill(if followers.is_none() {
|
||||
.bg(if followers.is_none() {
|
||||
system_color.transparent
|
||||
} else {
|
||||
player.selection_color(cx)
|
||||
|
|
|
@ -29,7 +29,7 @@ impl<S: 'static + Send + Sync + Clone> ProjectPanel<S> {
|
|||
.flex_col()
|
||||
.w_full()
|
||||
.h_full()
|
||||
.fill(color.surface)
|
||||
.bg(color.surface)
|
||||
.child(
|
||||
div()
|
||||
.w_full()
|
||||
|
|
|
@ -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))
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
|
|||
.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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
let git_statuses = GitStatus::iter();
|
||||
let fs_statuses = FileSystemStatus::iter();
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ impl<S: 'static + Send + Sync + Clone> TabBar<S> {
|
|||
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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, TabBar<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -32,7 +32,7 @@ impl<S: 'static + Send + Sync + Clone> Terminal<S> {
|
|||
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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -56,7 +56,7 @@ impl<S: 'static + Send + Sync> Toast<S> {
|
|||
.rounded_lg()
|
||||
.shadow_md()
|
||||
.overflow_hidden()
|
||||
.fill(color.elevated_surface)
|
||||
.bg(color.elevated_surface)
|
||||
.children(self.children.drain(..))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ impl<S: 'static + Send + Sync> Toolbar<S> {
|
|||
let theme = theme(cx);
|
||||
|
||||
div()
|
||||
.fill(theme.highest.base.default.background)
|
||||
.bg(theme.highest.base.default.background)
|
||||
.p_2()
|
||||
.flex()
|
||||
.justify_between()
|
||||
|
|
|
@ -37,7 +37,7 @@ impl<S: 'static + Send + Sync> TrafficLight<S> {
|
|||
(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<S>) -> impl Element<ViewState = S> {
|
||||
fn render(
|
||||
&mut self,
|
||||
_view: &mut S,
|
||||
cx: &mut ViewContext<S>,
|
||||
) -> impl Element<ViewState = S> {
|
||||
Story::container(cx)
|
||||
.child(Story::title_for::<_, TrafficLights<S>>(cx))
|
||||
.child(Story::label(cx, "Default"))
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue