Author Topic: Draggable panel with scrollbar, "when dragging" doesn't include scrolling?  (Read 4348 times)

ryan

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 90
    • View Profile
So I've got a draggable panel with a scrollbar, and the panel is set to only show the scrollbar when dragging.  That works great, but if I use the scroll wheel, this doesn't make the scrollbar visible like I would expect from a native Mac app.  I changed line 603 of UIDraggablePanel from this:

  1. if (showScrollBars != ShowCondition.WhenDragging || mDragID != -10)
  2.  

to this:

  1. if (showScrollBars != ShowCondition.WhenDragging || mDragID != -10 || mMomentum.magnitude > 0.01f)
  2.  

which makes the scrollbar visible while using the scroll wheel, and has the added benefit of leaving it visible after a drag while momentum is still being applied.  That threshold could maybe be tuned a little bit.  I started with 0.0001f as is used a few lines further down in the class, but that left the bar showing for a bit too long.  Any chance this, or a similar change, could be incorporated?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Yup, I will add it in.