table: Emit MoveCol when moved column. (#473)
This commit is contained in:
parent
d8636a31bd
commit
bf0e3a22de
2 changed files with 5 additions and 0 deletions
|
|
@ -673,6 +673,9 @@ impl TableStory {
|
|||
}
|
||||
TableEvent::SelectCol(ix) => println!("Select col: {}", ix),
|
||||
TableEvent::SelectRow(ix) => println!("Select row: {}", ix),
|
||||
TableEvent::MoveCol(origin_idx, target_idx) => {
|
||||
println!("Move col index: {} -> {}", origin_idx, target_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ pub enum TableEvent {
|
|||
SelectRow(usize),
|
||||
SelectCol(usize),
|
||||
ColWidthsChanged(Vec<Option<Pixels>>),
|
||||
MoveCol(usize, usize),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default)]
|
||||
|
|
@ -567,6 +568,7 @@ where
|
|||
let col_group = self.col_groups.remove(col_ix);
|
||||
self.col_groups.insert(to_ix, col_group);
|
||||
|
||||
cx.emit(TableEvent::MoveCol(col_ix, to_ix));
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue