BListView: Contain scroll within scroll area horizontally
... but extending vertically above and below the list view. https://www.haiku-os.org/legacy-docs/bebook/BListView_Overview.html "BListView provides an autoscroll feature: There's an invisible area about 25 pixels high both above and below the list view; if the user clicks inside the list view and then drags into this autoscroll area, the contents of the list will scroll in the direction of the mouse." Instead of 25px scroll vertically without limit because scrolling speeds up as you move the mouse cursor further away. Change-Id: I52296beb2b0173fc5c909255163e8725e99c2b6c Reviewed-on: https://review.haiku-os.org/c/haiku/+/7244 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
963681995c
commit
fd2a5629f1
@@ -742,6 +742,10 @@ BListView::MouseMoved(BPoint where, uint32 code, const BMessage* dragMessage)
|
||||
if (buttons == 0 || index == -1)
|
||||
return BView::MouseMoved(where, code, dragMessage);
|
||||
|
||||
// don't scroll if mouse is left or right of the view
|
||||
if (where.x < Bounds().left || where.x > Bounds().right)
|
||||
return BView::MouseMoved(where, code, dragMessage);
|
||||
|
||||
// scroll to item under mouse while button is pressed
|
||||
ScrollTo(index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user