sidebar: Better active menu background (#793)

This commit is contained in:
Floyd Wang 2025-04-15 14:36:02 +08:00 committed by GitHub
parent 8930acf648
commit 0c4a0538e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -161,12 +161,16 @@ impl RenderOnce for SidebarMenuItem {
.rounded(cx.theme().radius)
.text_sm()
.hover(|this| {
if is_active {
return this;
}
this.bg(cx.theme().sidebar_accent)
.text_color(cx.theme().sidebar_accent_foreground)
})
.when(is_active && !is_submenu, |this| {
this.font_medium()
.bg(cx.theme().sidebar_accent)
.bg(cx.theme().accent)
.text_color(cx.theme().sidebar_accent_foreground)
})
.when_some(self.icon.clone(), |this, icon| this.child(icon))