Merge remote-tracking branch 'origin/main' into cancel-clicks-on-drag

This commit is contained in:
Nathan Sobo
2023-12-20 15:01:10 -07:00
33 changed files with 2166 additions and 362 deletions
+17
View File
@@ -789,6 +789,7 @@ impl Pane {
}
self.update_toolbar(cx);
self.update_status_bar(cx);
if focus_item {
self.focus_active_item(cx);
@@ -1450,6 +1451,22 @@ impl Pane {
});
}
fn update_status_bar(&mut self, cx: &mut ViewContext<Self>) {
let workspace = self.workspace.clone();
let pane = cx.view().clone();
cx.window_context().defer(move |cx| {
let Ok(status_bar) = workspace.update(cx, |workspace, _| workspace.status_bar.clone())
else {
return;
};
status_bar.update(cx, move |status_bar, cx| {
status_bar.set_active_pane(&pane, cx);
});
});
}
fn render_tab(
&self,
ix: usize,
+9
View File
@@ -83,6 +83,9 @@ impl StatusBar {
where
T: 'static + StatusItemView,
{
let active_pane_item = self.active_pane.read(cx).active_item();
item.set_active_pane_item(active_pane_item.as_deref(), cx);
self.left_items.push(Box::new(item));
cx.notify();
}
@@ -119,6 +122,9 @@ impl StatusBar {
) where
T: 'static + StatusItemView,
{
let active_pane_item = self.active_pane.read(cx).active_item();
item.set_active_pane_item(active_pane_item.as_deref(), cx);
if position < self.left_items.len() {
self.left_items.insert(position + 1, Box::new(item))
} else {
@@ -141,6 +147,9 @@ impl StatusBar {
where
T: 'static + StatusItemView,
{
let active_pane_item = self.active_pane.read(cx).active_item();
item.set_active_pane_item(active_pane_item.as_deref(), cx);
self.right_items.push(Box::new(item));
cx.notify();
}
-1
View File
@@ -105,7 +105,6 @@ impl Render for Toolbar {
v_stack()
.p_1()
.gap_2()
.z_index(80) // todo!("z-index")
.border_b()
.border_color(cx.theme().colors().border_variant)
.bg(cx.theme().colors().toolbar_background)