vlang / ui

A cross-platform UI library written in V
MIT License
2.32k stars 154 forks source link

Remove gg.Context from UI and add ClippingWidget interface #500

Closed edam closed 1 year ago

edam commented 1 year ago

Initially, the following now conform to ClippingWidget interface and take a clipping param during setup:

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:

Other changes:

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
}