tree: implement tile dragging
This commit is contained in:
parent
83fd9f211e
commit
132986df2a
17 changed files with 925 additions and 52 deletions
|
|
@ -15,7 +15,7 @@ use {
|
|||
text::TextTexture,
|
||||
tree::{
|
||||
walker::NodeVisitor, ContainingNode, Direction, FindTreeResult, FindTreeUsecase,
|
||||
FoundNode, Node, NodeId, StackedNode, ToplevelNode, WorkspaceNode,
|
||||
FoundNode, Node, NodeId, StackedNode, TileDragDestination, ToplevelNode, WorkspaceNode,
|
||||
},
|
||||
utils::{
|
||||
asyncevent::AsyncEvent, clonecell::CloneCell, double_click_state::DoubleClickState,
|
||||
|
|
@ -528,6 +528,26 @@ impl FloatNode {
|
|||
self.set_workspace(&ws);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tile_drag_destination(
|
||||
self: &Rc<Self>,
|
||||
source: NodeId,
|
||||
abs_x: i32,
|
||||
abs_y: i32,
|
||||
) -> Option<TileDragDestination> {
|
||||
let child = self.child.get()?;
|
||||
let theme = &self.state.theme.sizes;
|
||||
let bw = theme.border_width.get();
|
||||
let th = theme.title_height.get();
|
||||
let pos = self.position.get();
|
||||
let body = Rect::new(
|
||||
pos.x1() + bw,
|
||||
pos.y1() + bw + th + 1,
|
||||
pos.x2() - bw,
|
||||
pos.y2() - bw,
|
||||
)?;
|
||||
child.tl_tile_drag_destination(source, None, body, abs_x, abs_y)
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for FloatNode {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue