it: test dnd focus change on drop
This commit is contained in:
parent
a39031d4f9
commit
c6b34550d8
16 changed files with 421 additions and 9 deletions
11
src/it/test_utils/test_rect_ext.rs
Normal file
11
src/it/test_utils/test_rect_ext.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use crate::rect::Rect;
|
||||
|
||||
pub trait TestRectExt {
|
||||
fn center(&self) -> (i32, i32);
|
||||
}
|
||||
|
||||
impl TestRectExt for Rect {
|
||||
fn center(&self) -> (i32, i32) {
|
||||
((self.x1() + self.x2()) / 2, (self.y1() + self.y2()) / 2)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::tree::ToplevelNode;
|
||||
use crate::{it::test_utils::test_rect_ext::TestRectExt, tree::ToplevelNode};
|
||||
|
||||
pub trait TestToplevelNodeExt {
|
||||
fn center(&self) -> (i32, i32);
|
||||
|
|
@ -6,7 +6,6 @@ pub trait TestToplevelNodeExt {
|
|||
|
||||
impl TestToplevelNodeExt for dyn ToplevelNode {
|
||||
fn center(&self) -> (i32, i32) {
|
||||
let rect = self.node_absolute_position();
|
||||
((rect.x1() + rect.x2()) / 2, (rect.y1() + rect.y2()) / 2)
|
||||
self.node_absolute_position().center()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue