Add on_drop listeners
This commit is contained in:
parent
38a7b39070
commit
ec0b2e5430
6 changed files with 112 additions and 70 deletions
|
@ -17,7 +17,7 @@ pub struct Tab<S: 'static + Send + Sync + Clone> {
|
|||
close_side: IconSide,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, Debug)]
|
||||
struct TabDragState {
|
||||
title: String,
|
||||
}
|
||||
|
@ -126,6 +126,9 @@ impl<S: 'static + Send + Sync + Clone> Tab<S> {
|
|||
Drag::new(drag_state.clone(), |view, cx| div().w_8().h_4().bg(red()))
|
||||
})
|
||||
.drag_over::<TabDragState>(|d| d.bg(black()))
|
||||
.on_drop(|_view, state: TabDragState, cx| {
|
||||
dbg!(state);
|
||||
})
|
||||
.px_2()
|
||||
.py_0p5()
|
||||
.flex()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue