Move internal events to a separate enum.#833
Conversation
| // Show the scrollbars any time our size changes | ||
| Event::Size(_) => self.reset_scrollbar_fade(ctx, &env), |
There was a problem hiding this comment.
This was a Scroll bug, but it's not easy to fix. More info in #834.
druid/src/event.rs
Outdated
| #[derive(Debug, Clone)] | ||
| pub enum InternalEvent { | ||
| /// Sent to the root widget when the window size changes. | ||
| Size(Size), |
There was a problem hiding this comment.
There's an ongoing question about whether or not this should actually be more widely used, and sent down the tree by default; and even if not I do think of it as public API, custom widgets would regularly want to handle it I think?
|
Well |
|
yes, it could be |
|
Okay, what about propagation? Still send it only to the root or to everyone? |
|
Wouldn't it be more useful if widgets could get an event when their own size changes? |
|
I'm somewhat skeptical of the value of the window size event as well. However for now I brought it back to the public |
As discussed in #826 this PR does the following:
Eventvariants into aInternalEventenum and adds theEvent::Internal(InternalEvent)variant.LifeCyclevariants into aInternalLifeCycleenum and adds theLifeCycle::Internal(InternalLifeCycle)variant.Closes #826