-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a Scroll
bug, but it's not easy to fix. More info in #834.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broadly good, but I'm unsure about Size. I haven't read #834 yet, which may be relevant? But my inclination is to not make size private, but maybe change its behaviour.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
Event
variants into aInternalEvent
enum and adds theEvent::Internal(InternalEvent)
variant.LifeCycle
variants into aInternalLifeCycle
enum and adds theLifeCycle::Internal(InternalLifeCycle)
variant.Closes #826