Initially, the following now conform to ClippingWidget interface and take a clipping param during setup:
Group (see examples/group2_resizable.v)
CanvasLayout (see new examples/nested_clipping.v)
Stack
TextBox
ListBox
Also, ScrollableWidget is now implemented in terms of an embedded ClippingWidget. So all scrollable widgets are now clipping widgets and force clipping on for the widget. Todo: enable/disable dynamically, as required. See new examples/nested_scrollview.v.
API/breaking changes:
all draw_device_*() widget/component functions now take a mut d DrawDevice (since the draw device holds mutable clipping info, as proposed).
Therefore, also, canvas on_draw() also takes a mut d DrawDevice too.
Other changes:
DrawDevice now formally defines what is expected from all draw devices
Use of gg.Context has been replaced with DrawDeviceContext (a draw device which embeds gg.Context).
Access to Window.ui.gg is deprecated (but still possible), but if access to the underlying gg.Context is neccessary, it can be achieved like this:
if w.ui.dd is ui.DrawDeviceContext {
// treat w.ui.dd like a gg.Context
}
Initially, the following now conform to
ClippingWidget
interface and take aclipping
param during setup:Group
(seeexamples/group2_resizable.v
)CanvasLayout
(see newexamples/nested_clipping.v
)Stack
TextBox
ListBox
Also,
ScrollableWidget
is now implemented in terms of an embeddedClippingWidget
. So all scrollable widgets are now clipping widgets and forceclipping
on for the widget. Todo: enable/disable dynamically, as required. See newexamples/nested_scrollview.v
.API/breaking changes:
draw_device_*()
widget/component functions now take amut d DrawDevice
(since the draw device holds mutable clipping info, as proposed).on_draw()
also takes amut d DrawDevice
too.Other changes:
gg.Context
has been replaced withDrawDeviceContext
(a draw device which embedsgg.Context
).Access to
Window.ui.gg
is deprecated (but still possible), but if access to the underlyinggg.Context
is neccessary, it can be achieved like this: