tree: implement tile dragging
This commit is contained in:
parent
83fd9f211e
commit
132986df2a
17 changed files with 925 additions and 52 deletions
|
|
@ -10,7 +10,8 @@ use {
|
|||
state::State,
|
||||
text::TextTexture,
|
||||
tree::{
|
||||
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor,
|
||||
default_tile_drag_destination, ContainerSplit, Direction, FindTreeResult,
|
||||
FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, TileDragDestination,
|
||||
ToplevelData, ToplevelNode, ToplevelNodeBase,
|
||||
},
|
||||
utils::{
|
||||
|
|
@ -62,6 +63,17 @@ impl PlaceholderNode {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn new_empty(state: &Rc<State>) -> Self {
|
||||
Self {
|
||||
id: state.node_ids.next(),
|
||||
toplevel: ToplevelData::new(state, String::new(), None),
|
||||
destroyed: Default::default(),
|
||||
update_textures_scheduled: Default::default(),
|
||||
state: state.clone(),
|
||||
textures: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_destroyed(&self) -> bool {
|
||||
self.destroyed.get()
|
||||
}
|
||||
|
|
@ -222,4 +234,15 @@ impl ToplevelNodeBase for PlaceholderNode {
|
|||
fn tl_admits_children(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn tl_tile_drag_destination(
|
||||
self: Rc<Self>,
|
||||
source: NodeId,
|
||||
split: Option<ContainerSplit>,
|
||||
abs_bounds: Rect,
|
||||
x: i32,
|
||||
y: i32,
|
||||
) -> Option<TileDragDestination> {
|
||||
default_tile_drag_destination(self, source, split, abs_bounds, x, y)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue