From 7e300079ce133818901a2b4f8c3dbc8543e92773 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Tue, 19 Sep 2023 08:31:22 -0400 Subject: [PATCH] WIP --- .../storybook/src/ui/component/list_item.rs | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/storybook/src/ui/component/list_item.rs b/crates/storybook/src/ui/component/list_item.rs index 099125b69cba591c8b283e2175b78c8a9b1215ac..9e6a2463df73803e5fad83795306cf77410629e8 100644 --- a/crates/storybook/src/ui/component/list_item.rs +++ b/crates/storybook/src/ui/component/list_item.rs @@ -2,7 +2,7 @@ use crate::prelude::InteractionState; use crate::theme::theme; use crate::ui::{icon, IconAsset, Label}; use gpui2::geometry::rems; -use gpui2::style::StyleHelpers; +use gpui2::style::{StyleHelpers, Styleable}; use gpui2::{elements::div, IntoElement}; use gpui2::{Element, ParentElement, ViewContext}; @@ -41,12 +41,20 @@ impl ListItem { let theme = theme(cx); let mut el = div() - .h_7() - .px_2() - .ml(rems(0.75 * self.indent_level.clone())) - .flex() - .gap_2() - .items_center(); + .fill(theme.middle.base.default.background) + .hover() + .fill(theme.middle.base.hovered.background) + .active() + .fill(theme.middle.base.pressed.background) + .child( + div() + .h_7() + .px_2() + .ml(rems(0.75 * self.indent_level.clone())) + .flex() + .gap_2() + .items_center(), + ); if self.left_icon.is_some() { el = el.child(icon(self.left_icon.clone().unwrap()))