diff --git a/crates/story/src/table_story.rs b/crates/story/src/table_story.rs
index 136a6d71..b3c82311 100644
--- a/crates/story/src/table_story.rs
+++ b/crates/story/src/table_story.rs
@@ -161,7 +161,12 @@ impl TableDelegate for CustomerTableDelegate {
return self.col_resize && col_ix > 1;
}
- fn render_td(&self, row_ix: usize, col_ix: usize, cx: &mut WindowContext) -> impl IntoElement {
+ fn render_td(
+ &self,
+ row_ix: usize,
+ col_ix: usize,
+ cx: &mut ViewContext
>,
+ ) -> impl IntoElement {
let customer = self.customers.get(row_ix).unwrap();
let col = self.columns.get(col_ix).unwrap();
@@ -224,7 +229,7 @@ impl TableDelegate for CustomerTableDelegate {
self.columns.get(col_ix).and_then(|c| c.sort)
}
- fn perform_sort(&mut self, col_ix: usize, sort: ColSort, _: &mut WindowContext) {
+ fn perform_sort(&mut self, col_ix: usize, sort: ColSort, _: &mut ViewContext>) {
if let Some(col) = self.columns.get_mut(col_ix) {
col.sort = Some(sort);
let asc = matches!(sort, ColSort::Ascending);
diff --git a/crates/ui/src/table.rs b/crates/ui/src/table.rs
index cc133f67..803d4640 100644
--- a/crates/ui/src/table.rs
+++ b/crates/ui/src/table.rs
@@ -144,20 +144,25 @@ pub trait TableDelegate: Sized + 'static {
}
/// Perform sort on the column at the given index.
- fn perform_sort(&mut self, col_ix: usize, sort: ColSort, cx: &mut WindowContext) {}
+ fn perform_sort(&mut self, col_ix: usize, sort: ColSort, cx: &mut ViewContext>) {}
/// Render the header cell at the given column index, default to the column name.
- fn render_th(&self, col_ix: usize, cx: &mut WindowContext) -> impl IntoElement {
+ fn render_th(&self, col_ix: usize, cx: &mut ViewContext>) -> impl IntoElement {
div().size_full().child(self.col_name(col_ix))
}
/// Render the row at the given row and column.
- fn render_tr(&self, row_ix: usize, cx: &mut WindowContext) -> Div {
+ fn render_tr(&self, row_ix: usize, cx: &mut ViewContext>) -> Div {
h_flex()
}
/// Render cell at the given row and column.
- fn render_td(&self, row_ix: usize, col_ix: usize, cx: &mut WindowContext) -> impl IntoElement;
+ fn render_td(
+ &self,
+ row_ix: usize,
+ col_ix: usize,
+ cx: &mut ViewContext>,
+ ) -> impl IntoElement;
/// Return true to enable loop selection on the table.
///