Realized that I was skipping invisible glyphs during construction of
MeasuredText. Once those were in, most of the issues vanished. A few
small tweaks and now it works surprisingly well.
- Blur no longer expands the shadow geometry, but instead is clamped to
avoid overlapping drawing calls.
- Overlay now handles hit tests correctly with regards to the original
relative widget.
- Align was using an Into conversion that wasn't actually correct,
causing the contents to not actually get aligned in some situations.
Rather than clip or cause shadows to be weirdly shaped, the shape is
adjusted if the blur radius is too large for the given geometry. This
ensures the shadows always draw correctly, but it also forces shadows to
render their full blur + spread gradients.
- On Linux, `fm-match` is used to query for the default fonts.
- DynamicComponents now have their own trait and can now be specified
with a constant or dynamic.
- Roboto Flex is now always loaded when the feature is enabled.
Overriding the default sans serif font prefers the overridden value,
then roboto, then the result of fc-match/fontdb's default.
- Button now supports background colors being set on a transparent
button.
Debug printing widgets was quite verbose. While developing a widget, you
often want to see a full debug printout, but this feature assumes that
debug printing a WidgetInstance should show a summary of the widget, not
a full debug printout containing cached glyph information of every
label.
By default, summarize just calls Debug, but this extra layer allows
widgets to provide a more condensed summary and exclude details like
caches.
Originally, adding dbg!() around the theme example's UI yielded a
whopping 20,324 lines of text. The summary code only prints 3,858
lines.
Installing a callback now returns a CallbackHandle. All map-style APIs
install this handle automatically on the created dynamic, which keeps
the callback installed until the dynamic is freed. All other APIs
return the handle for the caller to either call persist() or store
somewhere.
Now, the dynamic system can be used for application-long data with
almost no fear of leaking data due to how callbacks are being installed.
Technically cycles are still possible by moving clones into the
callbacks, so a WeakDynamic type might be worth exposing.
- Caching font family resolution to avoid scanning the database over and
over. The db should still be cached, but this makes repeated setting
free.
- into_switcher rename for Dynamic<WidgetInstance> to avoid conflicting
with Switchable::switcher()
- Dynamic debugging is less verbose
- IntoDynamic<Validation> for Result<T,E>
- Input no longer blinks cursor when disabled.
This expansion only triggers if the root widget measures larger than the
window's current size. We can't set a minimum size explicitly unless a
Resize widget is present, as we don't have enough knowledge to ensure
that the exact measurement we received was indeed the smallest layout in
any given direction. We only know that given the current constraints,
the returned measurement was the smallest possible. All future queries
will have to still be done again, as any change to the constraints could
impact the measured size.