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()
|
||||
},
|
||||
TabVariant::Pill => TabStyle {
|
||||
fg: cx.theme().accent_foreground,
|
||||
bg: cx.theme().accent,
|
||||
fg: cx.theme().secondary_foreground,
|
||||
bg: cx.theme().secondary_hover,
|
||||
borders: Edges::all(px(1.)),
|
||||
border_color: cx.theme().border,
|
||||
radius: px(99.),
|
||||
|
|
@ -210,7 +210,7 @@ impl TabVariant {
|
|||
fg: cx.theme().tab_foreground,
|
||||
bg: cx.theme().transparent,
|
||||
radius: px(0.),
|
||||
inner_bg: cx.theme().accent,
|
||||
inner_bg: cx.theme().secondary,
|
||||
inner_radius: cx.theme().radius,
|
||||
borders: Edges {
|
||||
bottom: px(2.),
|
||||
|
|
|
|||
|
|
@ -224,9 +224,12 @@ impl RenderOnce for TabBar {
|
|||
})
|
||||
}),
|
||||
)
|
||||
.when(self.variant == TabVariant::Tab, |this| {
|
||||
this.child(self.last_empty_space)
|
||||
}),
|
||||
.when(
|
||||
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))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue