Skip to content

Add viewport to Widget::on_event#1956

Merged
hecrj merged 1 commit intoiced-rs:masterfrom
tarkah:feat/on-event-viewport
Jul 15, 2023
Merged

Add viewport to Widget::on_event#1956
hecrj merged 1 commit intoiced-rs:masterfrom
tarkah:feat/on-event-viewport

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
@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

Comments