tab: Keep last empty when suffix exist. (#692)
This commit is contained in:
parent
c9c6449d24
commit
3a4f442945
2 changed files with 9 additions and 6 deletions
|
|
@ -188,8 +188,8 @@ impl TabVariant {
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
TabVariant::Pill => TabStyle {
|
TabVariant::Pill => TabStyle {
|
||||||
fg: cx.theme().accent_foreground,
|
fg: cx.theme().secondary_foreground,
|
||||||
bg: cx.theme().accent,
|
bg: cx.theme().secondary_hover,
|
||||||
borders: Edges::all(px(1.)),
|
borders: Edges::all(px(1.)),
|
||||||
border_color: cx.theme().border,
|
border_color: cx.theme().border,
|
||||||
radius: px(99.),
|
radius: px(99.),
|
||||||
|
|
@ -210,7 +210,7 @@ impl TabVariant {
|
||||||
fg: cx.theme().tab_foreground,
|
fg: cx.theme().tab_foreground,
|
||||||
bg: cx.theme().transparent,
|
bg: cx.theme().transparent,
|
||||||
radius: px(0.),
|
radius: px(0.),
|
||||||
inner_bg: cx.theme().accent,
|
inner_bg: cx.theme().secondary,
|
||||||
inner_radius: cx.theme().radius,
|
inner_radius: cx.theme().radius,
|
||||||
borders: Edges {
|
borders: Edges {
|
||||||
bottom: px(2.),
|
bottom: px(2.),
|
||||||
|
|
|
||||||
|
|
@ -224,9 +224,12 @@ impl RenderOnce for TabBar {
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.when(self.variant == TabVariant::Tab, |this| {
|
.when(
|
||||||
this.child(self.last_empty_space)
|
self.suffix.is_some() && self.variant == TabVariant::Tab
|
||||||
}),
|
|| self.variant == TabVariant::Underline
|
||||||
|
|| self.variant == TabVariant::Pill,
|
||||||
|
|this| this.child(self.last_empty_space),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.when_some(self.suffix, |this, suffix| this.child(suffix))
|
.when_some(self.suffix, |this, suffix| this.child(suffix))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue