Checkpoint

This commit is contained in:
Antonio Scandurra 2023-10-17 22:16:48 +02:00
parent a8697df9e3
commit 4db0350f06
18 changed files with 117 additions and 66 deletions

View file

@ -31,7 +31,11 @@ impl<S: 'static + Send + Sync + Clone> Breadcrumb<S> {
.text_color(HighlightColor::Default.hsla(theme))
}
fn render(&mut self, view_state: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(
&mut self,
view_state: &mut S,
cx: &mut ViewContext<S>,
) -> impl Element<ViewState = S> {
let theme = theme(cx);
let symbols_len = self.symbols.len();
@ -43,8 +47,7 @@ impl<S: 'static + Send + Sync + Clone> Breadcrumb<S> {
.text_sm()
.text_color(theme.middle.base.default.foreground)
.rounded_md()
.hover()
.fill(theme.highest.base.hovered.background)
.hover(|style| style.fill(theme.highest.base.hovered.background))
.child(self.path.clone().to_str().unwrap().to_string())
.child(if !self.symbols.is_empty() {
self.render_separator(&theme)
@ -99,7 +102,11 @@ mod stories {
}
}
fn render(&mut self, view_state: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
fn render(
&mut self,
view_state: &mut S,
cx: &mut ViewContext<S>,
) -> impl Element<ViewState = S> {
let theme = theme(cx);
Story::container(cx)

View file

@ -137,10 +137,8 @@ impl<S: 'static + Send + Sync + Clone> CollabPanel<S> {
.px_2()
.flex()
.items_center()
.hover()
.fill(theme.lowest.variant.hovered.background)
// .active()
// .fill(theme.lowest.variant.pressed.background)
.hover(|style| style.fill(theme.lowest.variant.hovered.background))
// .active(|style| style.fill(theme.lowest.variant.pressed.background))
.child(
div()
.flex()

View file

@ -91,8 +91,7 @@ impl<S: 'static + Send + Sync> IconButton<S> {
.items_center()
.justify_center()
.rounded_md()
.hover()
.fill(theme.highest.base.hovered.background)
.hover(|style| style.fill(theme.highest.base.hovered.background))
// .active()
// .fill(theme.highest.base.pressed.background)
.child(IconElement::new(self.icon).color(icon_color))

View file

@ -412,8 +412,7 @@ impl<S: 'static + Send + Sync + Clone> ListEntry<S> {
.h_full()
.flex()
.justify_center()
.group_hover("")
.fill(color.border_focused)
.group_hover("", |style| style.fill(color.border_focused))
.child(
h_stack()
.child(div().w_px().h_full())

View file

@ -1,6 +1,6 @@
use std::marker::PhantomData;
use gpui3::{Element, ParentElement, ViewContext};
use gpui3::{Element, ParentElement, Styled, ViewContext};
use crate::{
h_stack, v_stack, Button, Icon, IconButton, IconElement, Label, ThemeColor, Toast, ToastOrigin,

View file

@ -89,8 +89,7 @@ impl<S: 'static + Send + Sync + Clone> Palette<S> {
.px_2()
.py_0p5()
.rounded_lg()
.hover()
.fill(theme.lowest.base.hovered.background)
.hover(|style| style.fill(theme.lowest.base.hovered.background))
// .active()
// .fill(theme.lowest.base.pressed.background)
.child(item.clone())
@ -172,7 +171,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::<_, Palette<S>>(cx))
.child(Story::label(cx, "Default"))