From 721baf5746d176fe9c473876637ae8d36d9351b5 Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 18 Apr 2023 14:56:39 -0400 Subject: [PATCH] Re-render toolbar items when updating their knowledge of pane focus --- crates/workspace/src/toolbar.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/workspace/src/toolbar.rs b/crates/workspace/src/toolbar.rs index 7531ab9f92..bffca3e3c8 100644 --- a/crates/workspace/src/toolbar.rs +++ b/crates/workspace/src/toolbar.rs @@ -70,6 +70,7 @@ impl View for Toolbar { for (item, position) in &self.items { match *position { ToolbarItemLocation::Hidden => {} + ToolbarItemLocation::PrimaryLeft { flex } => { let left_item = ChildView::new(item.as_any(), cx) .aligned() @@ -81,6 +82,7 @@ impl View for Toolbar { primary_left_items.push(left_item.boxed()); } } + ToolbarItemLocation::PrimaryRight { flex } => { let right_item = ChildView::new(item.as_any(), cx) .aligned() @@ -93,6 +95,7 @@ impl View for Toolbar { primary_right_items.push(right_item.boxed()); } } + ToolbarItemLocation::Secondary => { secondary_item = Some( ChildView::new(item.as_any(), cx) @@ -300,7 +303,10 @@ impl ToolbarItemViewHandle for ViewHandle { } fn pane_focus_update(&mut self, pane_focused: bool, cx: &mut AppContext) { - self.update(cx, |this, cx| this.pane_focus_update(pane_focused, cx)); + self.update(cx, |this, cx| { + this.pane_focus_update(pane_focused, cx); + cx.notify(); + }); } }