This commit is contained in:
parent
991feb18c8
commit
1f3c70279a
7 changed files with 3076 additions and 107 deletions
42
src/ui/widgets/draggable/mod.rs
Normal file
42
src/ui/widgets/draggable/mod.rs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
use cosmic::iced::Point;
|
||||
|
||||
pub use self::column::column;
|
||||
pub use self::row::row;
|
||||
pub mod column;
|
||||
pub mod row;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum Action {
|
||||
Idle,
|
||||
Picking {
|
||||
index: usize,
|
||||
origin: Point,
|
||||
},
|
||||
Dragging {
|
||||
index: usize,
|
||||
origin: Point,
|
||||
last_cursor: Point,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum DropPosition {
|
||||
Before,
|
||||
Swap,
|
||||
After,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum DragEvent {
|
||||
Picked {
|
||||
index: usize,
|
||||
},
|
||||
Dropped {
|
||||
index: usize,
|
||||
target_index: usize,
|
||||
drop_position: DropPosition,
|
||||
},
|
||||
Canceled {
|
||||
index: usize,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue