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::{
|
use gpui::{
|
||||||
div, prelude::FluentBuilder as _, App, Div, IntoElement, ParentElement, RenderOnce,
|
App, Div, IntoElement, ParentElement, RenderOnce, SharedString, Styled as _, Window, div,
|
||||||
SharedString, Styled as _, Window,
|
prelude::FluentBuilder as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A group of items in the [`super::Sidebar`].
|
/// A group of items in the [`super::Sidebar`].
|
||||||
|
|
@ -56,7 +56,7 @@ impl<E: Collapsible + IntoElement> RenderOnce for SidebarGroup<E> {
|
||||||
.relative()
|
.relative()
|
||||||
.when(!self.collapsed, |this| {
|
.when(!self.collapsed, |this| {
|
||||||
this.child(
|
this.child(
|
||||||
div()
|
h_flex()
|
||||||
.flex_shrink_0()
|
.flex_shrink_0()
|
||||||
.px_2()
|
.px_2()
|
||||||
.rounded(cx.theme().radius)
|
.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("content").flex_1().min_h_0().child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.id("inner")
|
.id("inner")
|
||||||
.gap_3()
|
|
||||||
.p_3()
|
.p_3()
|
||||||
.when(self.collapsed, |this| this.p_2())
|
.when(self.collapsed, |this| this.p_2())
|
||||||
.children(
|
.children(
|
||||||
self.content
|
self.content.into_iter().enumerate().map(|(ix, c)| {
|
||||||
.into_iter()
|
div().id(ix).mt_3().child(c.collapsed(self.collapsed))
|
||||||
.enumerate()
|
}),
|
||||||
.map(|(ix, c)| div().id(ix).child(c.collapsed(self.collapsed))),
|
|
||||||
)
|
)
|
||||||
.overflow_y_scrollbar(),
|
.overflow_y_scrollbar(),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue