Skip to content
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

Add viewport to Widget::on_event #1956

Merged
merged 1 commit into from
Jul 15, 2023
Merged

Conversation

tarkah
Copy link
Member

@tarkah tarkah commented Jul 15, 2023

As a widget creator, I want to be able to access viewport in on_event to understand if the widget is within view or not. This will allow me to cull expensive event logic for widgets not visible. It will also allow me to create new widgets that can emit messages when they become visible in the viewport (during RedrawRequested).

This specifically allows for creating some nice optimizations and behavior around elements inside a scrollable.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I just needed this!

Thanks 🥳

@hecrj hecrj merged commit fd07791 into iced-rs:master Jul 15, 2023
9 checks passed
@hecrj hecrj added feature New feature or request widget shell labels Jul 15, 2023
@hecrj hecrj added this to the 0.10.0 milestone Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request shell widget
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants