Fix tab bar button's focus handling lagging behind

This fixes https://github.com/zed-industries/community/issues/2442 for
me.

Previously, the tab bar buttons would stay when the chat panel was
opened (and received focus) until something else was drawn (or caused a
render?)

With this change, the tab bar buttons are only shown if the pane was
focus.

I'm not sure about the side-effects of this, but the toolbar still seems
to work fine.
This commit is contained in:
Thorsten Ball 2024-01-24 11:47:59 +01:00
parent e01850642f
commit 027f425804

View file

@ -1470,7 +1470,7 @@ impl Pane {
),
)
})
.when(self.was_focused || self.has_focus(cx), |tab_bar| {
.when(self.has_focus(cx), |tab_bar| {
tab_bar.end_child({
let render_tab_buttons = self.render_tab_bar_buttons.clone();
render_tab_buttons(self, cx)