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

Pass ignored events to program #1230

Merged
merged 1 commit into from
Sep 28, 2022
Merged

Conversation

kaimast
Copy link
Contributor

@kaimast kaimast commented Feb 3, 2022

This pull request aims to make the issues addressed in #408 a little easier to solve. Currently, you have to re-implement program::State which seems like a bad idea just to capture events.

I think in the future iced needs to receive proper focus handling, but for now this change would be very helpful for me at least.

@@ -153,7 +152,17 @@ where
self.cache = Some(user_interface.into_cache());

Some(commands)
};

// Allow for the program to handle any uncaptured event
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I needed to move this down here to make the borrow checker happy

@hecrj hecrj added improvement An internal improvement feature New feature or request shell labels Sep 28, 2022
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.

Thanks! 🙇

I think we can simply return the ignored events as a result of program::State::update instead of changing the Program trait as well.

I just rebased and did exactly that in c9b8dbd.

@hecrj hecrj added this to the 0.5.0 milestone Sep 28, 2022
@hecrj hecrj merged commit 97f385e into iced-rs:master Sep 28, 2022
@kaimast
Copy link
Contributor Author

kaimast commented Sep 29, 2022

Either is fine. Thanks so much for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request improvement An internal improvement shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants