How does moving the scrollbars actually work? #2775
-
Hoping I had some better understanding of mouse 'grab and drag' functionality after generous help with my last question, I had another look at the code for the scrollbars. Granted I'm probably in too deep given that the "scrollbar-related widgets [are] for internal use" only, but I am really curious how moving the scrollbars actually works! I've looked at the code for various widgets that use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Happy to share how we did things! Anything in particular that needs explaining? |
Beta Was this translation helpful? Give feedback.
The mouse move events is handled in the
on_mouse_move
handler, which gets the mouse coordinates. That ultimately callsWidget._scroll_to
which modifiesscroll_x
andscroll_y
. Those have watch methods which adjust theposition
attribute of the scrollbars.You may be right about
action_released
! Looks like that functionality is handled inon_mouse_up