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

Touch support for PaneGrid and PickList #650

Merged
merged 14 commits into from
Feb 12, 2021
Merged

Conversation

discordance
Copy link
Contributor

Hello !
I was trying Iced and found the workflow amazing. 
With folks we were interested to see how it would play on iOS and, long story short, here is my take porting Simlay’s work on Touch support PR for the new 0.2 API.

Widgets are almost complete, and I can test the easy way thanks to this super cool project:

cargo-mobile


I have cool results on devices and simulators with few rough edges.
I have a small crash with font-kit and the system font loading, I worked around by using default fonts for now.

It misses the virtual keyboard management on mobile, but it is out of scope of this PR as it seems to be a winit fix as discussed on Zulip’s thread.

Here is how I could make it work in cargo-mobile :

1 - Installed, then generated a new cargo-mobile project using the winit template.
2 - Ported one of the simplest Iced example in the lib.rs.
3 - Open the project in Xcode with cargo apple open.
4 - Added CoreText in the list of Frameworks linked.
5 - Disabled Metal Validation API .

I’m open to give a bit of extra work here if needed!

Cheers!

@matthieugayon
Copy link

It works ! I believe **5 - Disabled Metal Validation API ** is related to

#511

and

gfx-rs/wgpu#185

@discordance
Copy link
Contributor Author

discordance commented Dec 5, 2020

Some demo GIF:
(It's at least 2x faster on the new Apple M1 👍 )

dem1

@matthieugayon
Copy link

I just did a PR on cargo mobile BrainiumLLC/cargo-mobile#4
It's based on the tour example and it's pointing to this branch :)

@ammen99
Copy link

ammen99 commented Dec 7, 2020

I have also tested this on my laptop with a touchscreen, works for such devices as well!

@hecrj
Copy link
Member

hecrj commented Dec 15, 2020

Looks promising! Thank you!

Would it be possible to keep the commit history of #57? Maybe we could rebase that branch and then apply these changes on top. It'd be easier to review the changes that way.

Let me try to rebase #57 on top of master. I'll let you know how that goes.

@hecrj hecrj mentioned this pull request Dec 15, 2020
@hecrj
Copy link
Member

hecrj commented Dec 15, 2020

I have successfully resolved the conflicts in #57. I'd appreciate any feedback there! It's very likely I missed something.

As I mentioned in #57 (comment), this PR seems to be adding touch support to the PaneGrid and PickList so it would be great if we could rebase the changes here on top of that branch.

The idea is to merge #57 first, which includes the touch::Event foundations and basic widget support. After that, we can merge this one, which introduces touch support for additional widgets.

@hecrj hecrj added the feature New feature or request label Dec 15, 2020
@hecrj hecrj added this to the 0.3.0 milestone Dec 15, 2020
@discordance
Copy link
Contributor Author

discordance commented Dec 19, 2020

Ok got it, makes total sense, I will look into rebasing this PR on top of master (since #57 was merged)

@cryptoquick
Copy link

I'm so excited to see this work! I was tempted to investigate, also. Once this is merged in, what else would be needed to get, say, the todo list example building for mobile?

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 a lot for rebasing! 🎉

I have changed a bunch of minor details but everything looks good! I think we can finally merge this 🥳

@hecrj hecrj changed the title Touch support for 0.2 Touch support for PaneGrid and PickList Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants