Closes#60
Stepping in sliders is a compromise due to the flexibility of the
current slider implementation. I don't want to force types to implement
Add, and I don't like forcing types to require a Step (ie, what's the
appropriate value for f32 to specify as its next value?). Using a
percentage combined with lerp keeps the implementation fairly
straightfoward, although I remember experiencing this type of
configuration in another UI framework a long time ago and thinking it
was a little annoying to work with.
Ultimately, setting actual step boundaries can be done by customizing
the type that the slider is operating over. I feel like that's a much
more powerful design than I've experienced in previous frameworks, so
I'm hoping this percent step behavior is a reasonable compromise.
Inset outlines may not be the right approach, but it simplifies
potential alignment issues caused by insetting all filled background
drawing by half the width of the focus ring.
After trying to run Gooey again on my Mac for the first time in a few
weeks, I found that I ran into the Condvar issue again. Rather than
pasting AssertUnwindSafe in those files, I've both reported the
discrepency in unwind safety (rust-lang/rust#118009) and moved the
workaround into a type that only uses AssertUnwindsafe when compiling
for Apple.
The issue was that my last set of changes were causing the animations to
restart, causing the animation to keep being extended to another 150ms.
I think the only way for this to work is to switch to an event
mechanism to notify widgets once they've been invalidated. This event
could include a parameter stating whether it was a direct invalidation
or an invalidation due to another widget in the hierarchy. Button
doesn't really care about the rest of the hierarchy, it only cares about
its own state, and the cache key was including too many changes.
This also fixes some inconsistencies that arose when the focus widget
was "stuck" on a removed widget. Button previously handled it hackily in
a redraw function, but now Gooey handles it automatically without
needing to wait for a repaint.