Encapsulate scrolling logic in a single Scroll
(i.e. scrollable container) widget
#711
Labels
Scroll
(i.e. scrollable container) widget
#711
Right now, scrolling logic is baked into conrod itself as a special case. This is slightly unfortunate, as it would be nice to be able to treat scrollbars and scrollable containers just as any other widget is treated. Ideally, we'd have a single
Scroll
widget, which is able to crop and scroll its children widgets. This would allow us to remove the need for trackingScrollbar
s specially within the graph (and in turn allow us to remove thedepth_order::Visitable
type). We could also remove all the scroll logic that is currently nested within thewidget::set_widget
function.There are a few reasons why scroll logic is baked into conrod itself right now:
.crop_kids
, so this point shouldn't hold us back.xy
offset to child widgets: there is currently no way for a parent to offset its children widgets (or for a widget to affect the co-ordinates of other widget whatsoever). Normally I think it can be a little dangerous to allow widgets to "mutate" other widgets, however I think it should be reasonable for us to add a method which would allow for a parent to offset its children widgets. I.e..offset_kids
.graph::algo
module.ui.drain_scroll(xy) -> Option<Point>
which would allow for a widget to "drain" a certain amount of scroll from theUi
's storedScroll
events? Will have to think about this some more.I think I'll avoid updating the scroll logic in #703 in favour of including this widget in a follow up PR.
The text was updated successfully, but these errors were encountered: