diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-08 16:46:22 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-08 16:46:22 -0500 |
commit | 920f1f010284d59bad86f78355ed90ac2f3e1d2c (patch) | |
tree | 19e2abcf6f546e251151582c700cfce312224eb1 /src/user/raleigh/w/vbox.cpp | |
parent | af52ddac750311ace3bd997245771b26119e1659 (diff) | |
download | portland-os-920f1f010284d59bad86f78355ed90ac2f3e1d2c.tar.gz |
mouse movement in raleigh, with colorpicker dragging example
Diffstat (limited to 'src/user/raleigh/w/vbox.cpp')
-rw-r--r-- | src/user/raleigh/w/vbox.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/user/raleigh/w/vbox.cpp b/src/user/raleigh/w/vbox.cpp index 263da2a..77ce592 100644 --- a/src/user/raleigh/w/vbox.cpp +++ b/src/user/raleigh/w/vbox.cpp @@ -63,4 +63,15 @@ namespace raleigh { notify_window_change(); } } + + void vbox::on_mouse_move(coord window_coords) { + for (dllist<widget &>::node *n = widgets.first; n; n = n->next) + if ((window_coords.x >= n->d.window_offset.x) && + (window_coords.y >= n->d.window_offset.y) && + (window_coords.x < n->d.window_offset.x + n->d.size.x) && + (window_coords.y < n->d.window_offset.y + n->d.size.y)) { + n->d.on_mouse_move(window_coords); + return; + } + } }
\ No newline at end of file |