iced_aw icon indicating copy to clipboard operation
iced_aw copied to clipboard

request: make iced_aw work with the latest iced

Open DavidBJaffe opened this issue 3 years ago • 24 comments

It would be wonderful if one could use the master versions of both iced and iced_aw. As best I can tell, this is not currently possible, because iced_aw uses the crates.io versions of iced crates, and this leads to two different versions of the same iced crate in use at the same time, which won't compile.

In principle this might be enabled by iced_aw specifying iced crates using the general form

iced... = { git = "https://github.com/hecrj/iced", version = "..." }

I started a PR to do this, but ran into issues with the use of Padding. I could try to fix this, but am not sure I'd be making the correct changes.

DavidBJaffe avatar Jun 19 '21 22:06 DavidBJaffe

I currently have a version which works with the latest git release of Iced.

https://github.com/genusistimelord/iced_aw/tree/iced-main

feel free to use it. I am ATM just waiting for them to accept my current patch's before i ask to add a Iced_main branch to the list of branches.

genusistimelord avatar Jun 21 '21 13:06 genusistimelord

Since I encountered the similar problem myself today, I think it's a good idea to support the current version as well. However, I still have two concerns about this:

  • Possibly this could lead to a split of this repository. For example, the question would arise for which version new widgets should be implemented. For the stable release of iced or for the latest HEAD.

  • It could end in a race. If iced would receive a new commit, you would have to catch up with this commit to get back to the latest state.

How do you see this?

Kaiden42 avatar Jun 21 '21 21:06 Kaiden42

I see that we can set it to a set Repository Version that way we update to their next commits when we see that it will work without any changes. but if changes are needed we don't need to switch to the latest till they are implemented. It is good to have something even if its not fully caught up. Since its further ahead than sticking to stable so it will allow people to make more widgets that might only be made with a newer versions of iced.

I don't Expect it to stay at the latest Version at all times but at least have a chance to get there.

genusistimelord avatar Jun 21 '21 23:06 genusistimelord

Can you please specify the Cargo.toml entries that you use to get the latest iced and iced_aw?

DavidBJaffe avatar Jun 22 '21 16:06 DavidBJaffe

for now just add

iced = { git = "https://github.com/genusistimelord/iced.git", features = ["canvas", "tokio", "image", "debug", "wgpu"] } iced_aw = { git = "https://github.com/genusistimelord/iced_aw.git", branch = "iced-main", default-features = false, features = ["number_input", "color_picker", "colors"] }

this will give you the ability to use the last updated iced with iced_aw with all my updates to fix some known issues.

I will need to work out something with @Kaiden42 to see if we can start a beta branch for the latest Iced Git.

genusistimelord avatar Jun 22 '21 17:06 genusistimelord

I see that we can set it to a set Repository Version that way we update to their next commits when we see that it will work without any changes. but if changes are needed we don't need to switch to the latest till they are implemented. It is good to have something even if its not fully caught up. Since its further ahead than sticking to stable so it will allow people to make more widgets that might only be made with a newer versions of iced.

I don't Expect it to stay at the latest Version at all times but at least have a chance to get there.

Thanks for the clarification and I totally agree with you. I've now created a new beta branch from the current main.

I will need to work out something with @Kaiden42 to see if we can start a beta branch for the latest Iced Git.

Do you have a suggestion on how we can best address this issue?

Kaiden42 avatar Jun 29 '21 21:06 Kaiden42

Making a Beta branch probably is a good start towards integrating the latest versions. I Will pull down all my changes from my branch and update them to this new Beta Branch. This way we can be caught up to the current Iced. Thank you for taking the time to Add the Beta Branch! Also if you are not too busy you can probably add me on Telegram: @genusis or Discord: Genusis#1548.

genusistimelord avatar Jun 30 '21 00:06 genusistimelord

Beta Branch will be updated soon once I am able to add any finishing Touches to my Selection List changes.

genusistimelord avatar Jul 14 '21 00:07 genusistimelord

Beta is now to the latest of Iced as of today.

genusistimelord avatar Oct 22 '21 17:10 genusistimelord

Seems like beta stopped working on latest iced again...

kaimast avatar Feb 05 '22 05:02 kaimast

yeah ill have to update it again to the latest. they made a ton of breaking changes for iced 4.0 though XD.

genusistimelord avatar Feb 05 '22 15:02 genusistimelord

Yup... I tried to do it last night but it was much harder than I thought (to be fair I don't know the iced or iced_aw codebase that well).

iced_web also got removed completely so that changes a bunch of things.

kaimast avatar Feb 05 '22 19:02 kaimast

iced_web got moved to its own Repo. the others I need to see what they replaced the current things with and update accordingly Might need some help from either @hecrj and/or @Kaiden42

genusistimelord avatar Feb 05 '22 22:02 genusistimelord

Coming week I can take a look at adapting iced_aw back to the latest version of iced.

Kaiden42 avatar Feb 06 '22 04:02 Kaiden42

I can help change things over too just I have no idea what changes were made yet and as to why. If need be we can open a new branch based on beta to make the changes in. that way we will be ahead of the game when iced v0.4 is released.

genusistimelord avatar Feb 06 '22 20:02 genusistimelord

Alright, I now have a rough overview of the breaking changes that need to be fixed and I've opened up a PR (#46). The moving of iced_web into it's own repository seems to be our smallest problem.

The bigger breaking change is how a widget is rendered. A widget doesn't have it's own rendering trait anymore. The renderer implementation is now directly implemented into the draw method of the widget. Therefore the struct DrawEnvironment isn't necessary anymore as it's only purpose was to reduce the number of arguments of the renderer trait's function to satisfy clippy.

In addition the draw function does not return a value anymore. The drawing is directly done using the drawing functions of the iced_native::Renderer (or iced_native::text::Renderer for text).

My plan is as following:

  1. Starting with all "normal" widgets and fix all occurring compiler errors by taking it to the newer rendering strategy
  2. Continuing with all "overlay" widgets (should be the same as with the "normal" widgets but I haven't tried it yet)
  3. When the project successfully compiles again, implement the new mouse_interaction method of the Widget trait and find out how to do a clip with the new kind of renderer (eg. for the Split widget).
  4. Verify that everything works like before

I am currently at step one and have (hopefully) finished the widgets: Badge, Card, Grid, IconText, NumberInput and Split

The "normal" widgets that are left are: Tab, TabBar and Wrap.

@genusistimelord If you like, you could take a look at the TabBar and Tabs widget. They should be as easy as the widgets that are already done. I recommend looking at the Badge and Card widgets to understand what needs to be done. The Wrap widget could be a little bit tricky.

Tomorrow I will take a look at step 2 of my plan.

Kaiden42 avatar Feb 09 '22 00:02 Kaiden42

OK I will take a look at the changes you did to Badge and Card and implement them into TabBar and Tabs tomorrow. If I complete them or if I have any issues I will let you know ASAP. Also is there any Discord/Telegram or some sort of chat type system other than here I can get a hold of you at?

genusistimelord avatar Feb 09 '22 01:02 genusistimelord

OK I will take a look at the changes you did to Badge and Card and implement them into TabBar and Tabs tomorrow.

Great! Thank you very much.

If I complete them or if I have any issues I will let you know ASAP. Also is there any Discord/Telegram or some sort of chat type system other than here I can get a hold of you at?

I've send you a friend request on discord.

Kaiden42 avatar Feb 09 '22 01:02 Kaiden42

The transition is now complete #46 ! Thanks to @genusistimelord for helping me out with this!

However the web build is currently broken (see: this issue)

Kaiden42 avatar Feb 10 '22 23:02 Kaiden42

This is great. Thanks so much!

One more thing considering is to move from hecrj/iced to iced-rs/iced.

kaimast avatar Feb 16 '22 00:02 kaimast

Yeah we forgot about that when we were quickly updating everything. Though we do still have issues with iced-web since this has not been updated yet....

genusistimelord avatar Feb 16 '22 12:02 genusistimelord

I have made another update to beta to support the newest iced release 0.4. We will need to discuss how we plan to add in pure widgets to iced_aw @Kaiden42. I am thinking we have 2 ways we can go about this either A drop all impure widgets and support pure only since iced supports pure with impure or separate and clone each widget into a new folder called pure and make pure versions of each. I also set the Cargo.toml so it will be easier to switch between full releases and git repo's.

We should split the web stuff into iced_web_aw and no longer have web inside iced_aw which will make it easier to keep iced_aw updated.

genusistimelord avatar May 03 '22 18:05 genusistimelord

Looks like iced removed impure widgets on master, would be nice to have an updated beta branch for iced_aw.

m00nwtchr avatar Sep 27 '22 20:09 m00nwtchr

yeah I can start Getting beta changed over to using Pure only for Main. Probably will Start Tomorrow.

genusistimelord avatar Sep 27 '22 20:09 genusistimelord

update ?

paulcomte avatar Dec 04 '22 23:12 paulcomte

it should work with Iced 0.5.2. Just @Kaiden42 has not released a new version on crates for it yet. if you want iced master we have not done any newer stuff yet.

genusistimelord avatar Dec 04 '22 23:12 genusistimelord

I've tried making it work with the latest version of iced (0.5.2) using the main branch, but when creating a color_picker the compiler says that two versions of the crate iced might be in use.

color_picker points to iced_core::color::Color whereas I have only iced::Color,

paulcomte avatar Dec 05 '22 08:12 paulcomte

you wont be able to use Iced's github main branch with the current git here. ATM this is only for iced on crates.io. We have not updated to any new git changes for iced main yet.

genusistimelord avatar Dec 05 '22 16:12 genusistimelord

I've tried making it work with the latest version of iced (0.5.2) using the main branch, but when creating a color_picker the compiler says that two versions of the crate iced might be in use.

This probably won't work in this specific case, but in general if you get an error like this you would need to override the dependencies of the crate importing the "wrong" version like it is described here.

kaimast avatar Dec 05 '22 16:12 kaimast

It might work unless there have been some major changes in main that need to be added.

genusistimelord avatar Dec 05 '22 16:12 genusistimelord