Commit Graph

4 Commits

Author SHA1 Message Date
FrHun
dab7ec190e LibGUI: Margins for AbstractScrollableWidget
Implement, and use internally, content_margins() from Widget.
Since AbstractScrollableWidget already has a method called content_size,
the convenience method, with the same name, in Widget has to be
explicitly called.
2021-11-03 16:13:19 +01:00
Marcus Nilsson
53cfc6ec9f LibGUI: Account for scrollbar width when calculating autoscroll delta 2021-09-29 23:58:55 +02:00
Marcus Nilsson
eec411c508 LibGUI: Add a AutoScroll timer to AbstractScrollableWidget
This commit adds a timer to AbstractScrollableWidget that can be used
when implementing automatic scrolling. By overriding
on_automatic_scrolling_timer_fired() we can calculate the scrolling
delta when dragging objects, and redraw as needed. A helper function,
automatic_scroll_delta_from_position() gives us a delta that
we can use to calculate speed and direction. By default
m_autoscroll_threshold is 20 pixels from the edge, and gives a linear
change in scroll delta.
2021-09-16 22:29:21 +02:00
Andreas Kling
f7de453716 LibGUI: Rename ScrollableWidget.cpp => AbstractScrollableWidget.cpp 2021-05-04 14:38:43 +02:00