You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@cmyr proposed the idea of the painter widget handling events, in one of the zulip threads. Essentially he said
What i would do is add a new builder method to painter, with a name like... hm. paint_on_mouse_change? And that sets a bool in the painter that indicates it should invalidate itself during these events. A more robust way might be a builder fn, invalidate(mut self, fn: impl Fn(&Event) -> bool) -> Self? Basically you can pass it a closure that will receive an event and you can return a flag indicating whether you need to repaint. 🤔
I'm bringing this up in case it's still something up for consideration.
The text was updated successfully, but these errors were encountered:
To summarize: there's currently a limitation with the painter widget where it doesn't repaint when things like hot or active change, which make it not very useful if you're trying to paint the background for a custom button.
(The button example isn't the best because buttons request paint on hot/active change themselves, and so the painter does get repainted; but other widgets might not).
The rationale for this choice was that having it do this by default would cause a bunch of unnecessary paint calls if you didn't actually need it.
The current solution is to make sure some other widget in your hierarchy is handling this invalidation; if nothing is, you can use a custom controller or something.
My proposed solution is be to allow Painter to be optionally configured to do this itself; you can specify in some way that it should repaint on certain events (either by setting a repaint_on_mouse_change flag, or else by passing some closure Fn(&Event) -> bool that lets you specify exactly when you want to repaint).
@cmyr proposed the idea of the painter widget handling events, in one of the zulip threads. Essentially he said
I'm bringing this up in case it's still something up for consideration.
The text was updated successfully, but these errors were encountered: