From 9a145a4d866ad2641725d6e0298f1c6f68d48765 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Tue, 21 Nov 2023 12:40:48 -0500 Subject: [PATCH] Correctly position popover aside, add list item states Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com> --- crates/ui2/src/components/list.rs | 3 ++- crates/ui2/src/components/popover.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs index b054a568fc..0266ae3342 100644 --- a/crates/ui2/src/components/list.rs +++ b/crates/ui2/src/components/list.rs @@ -364,12 +364,13 @@ impl Component for ListItem { } } }) - .bg(cx.theme().colors().surface_background) // TODO: Add focus state // .when(self.state == InteractionState::Focused, |this| { // this.border() // .border_color(cx.theme().colors().border_focused) // }) + .hover(|style| style.bg(cx.theme().colors().ghost_element_hover)) + .active(|style| style.bg(cx.theme().colors().ghost_element_active)) .child( sized_item .when(self.variant == ListItemVariant::Inset, |this| this.px_2()) diff --git a/crates/ui2/src/components/popover.rs b/crates/ui2/src/components/popover.rs index a919cc5417..e2aec4810f 100644 --- a/crates/ui2/src/components/popover.rs +++ b/crates/ui2/src/components/popover.rs @@ -27,7 +27,8 @@ impl Component for Popover { this.child( v_stack() .top_0() - .neg_right_1() + .left_full() + .ml_1() .absolute() .elevation_2(cx) .p_1()