sidebar: Fix Sidebar group and items gap. (#1705)
This commit is contained in:
parent
df9655e80a
commit
1ce09cc1d1
2 changed files with 7 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{v_flex, ActiveTheme, Collapsible};
|
||||
use crate::{ActiveTheme, Collapsible, h_flex, v_flex};
|
||||
use gpui::{
|
||||
div, prelude::FluentBuilder as _, App, Div, IntoElement, ParentElement, RenderOnce,
|
||||
SharedString, Styled as _, Window,
|
||||
App, Div, IntoElement, ParentElement, RenderOnce, SharedString, Styled as _, Window, div,
|
||||
prelude::FluentBuilder as _,
|
||||
};
|
||||
|
||||
/// A group of items in the [`super::Sidebar`].
|
||||
|
|
@ -56,7 +56,7 @@ impl<E: Collapsible + IntoElement> RenderOnce for SidebarGroup<E> {
|
|||
.relative()
|
||||
.when(!self.collapsed, |this| {
|
||||
this.child(
|
||||
div()
|
||||
h_flex()
|
||||
.flex_shrink_0()
|
||||
.px_2()
|
||||
.rounded(cx.theme().radius)
|
||||
|
|
|
|||
|
|
@ -221,14 +221,12 @@ impl<E: Collapsible + IntoElement> RenderOnce for Sidebar<E> {
|
|||
v_flex().id("content").flex_1().min_h_0().child(
|
||||
v_flex()
|
||||
.id("inner")
|
||||
.gap_3()
|
||||
.p_3()
|
||||
.when(self.collapsed, |this| this.p_2())
|
||||
.children(
|
||||
self.content
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(ix, c)| div().id(ix).child(c.collapsed(self.collapsed))),
|
||||
self.content.into_iter().enumerate().map(|(ix, c)| {
|
||||
div().id(ix).mt_3().child(c.collapsed(self.collapsed))
|
||||
}),
|
||||
)
|
||||
.overflow_y_scrollbar(),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue