offset_x: f32 = 0.0, offset_y: f32 = 0.0
(&self, item: &dyn Element, offset_x: f32, offset_y: f32)
| 73 | |
| 74 | // offset_x: f32 = 0.0, offset_y: f32 = 0.0 |
| 75 | pub fn add_item(&self, item: &dyn Element, offset_x: f32, offset_y: f32) { |
| 76 | let childbounds = &self.view.container.children_bounds(); |
| 77 | |
| 78 | item.set_y_local(item.y_local() + (childbounds.y_local + childbounds.h) + offset_y); |
| 79 | item.set_x_local(item.x_local() + offset_x); |
| 80 | |
| 81 | self.view.add(item); |
| 82 | |
| 83 | // item.mouse_input = true; |
| 84 | let mut items = self.items.borrow_mut(); |
| 85 | items.push(item.id()); |
| 86 | |
| 87 | // item.onmouseup.listen(box |e| { |
| 88 | // // self.item_mouseup(e, item.id()) |
| 89 | // }); |
| 90 | // item.onmouseenter.listen(box |e| { |
| 91 | // // self.item_mouseenter(e, item.id()) |
| 92 | // }); |
| 93 | // item.onmouseleave.listen(box |e| { |
| 94 | // // self.item_mouseleave(e, item.id()) |
| 95 | // }); |
| 96 | } |
| 97 | |
| 98 | fn item_mouseenter(&self, event: &MouseEvent, ctrl: Id) { |
| 99 | let items = self.items.borrow(); |
nothing calls this directly
no test coverage detected