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

TabBar and Tabs doesn't work with iced cloned from github #320

Open
C-Entropy opened this issue Feb 6, 2025 · 14 comments
Open

TabBar and Tabs doesn't work with iced cloned from github #320

C-Entropy opened this issue Feb 6, 2025 · 14 comments

Comments

@C-Entropy
Copy link

C-Entropy commented Feb 6, 2025

I am using iced master with iced_aw bd6b149, and TabBar and Tabs doesn't work.

I'm using the latest commit because it add support for CJK input method.

the trait bound Theme: iced_aw::tab_bar::Catalog is not satisfied
the trait iced_aw::tab_bar::Catalog is implemented for

Cargo.toml

[dependencies]
iced = { git = "https://github.com/iced-rs/iced.git", features = ["tokio", "advanced"] }
iced_aw = { git = "https://github.com/iced-rs/iced_aw.git",  default-features = false, features = ["tab_bar", "tabs"] }

then just put anything from examples into src folder

@Ultraxime
Copy link
Collaborator

Hi,

To solve the first error, you need to add the feature image for Iced so that you can run the example.

Then the current master branch of iced_aw is using the release version (1.13.1) of iced, not their master branch.

I hope that by updating both issues will solve your issue altogether.

@C-Entropy
Copy link
Author

Thanks, is there something like beta branch against the iced main?

It seems that it will take a long time for a new version of iced to be released, while there are some great updates.

@Ultraxime
Copy link
Collaborator

I haven't started porting the beta branch of iced. And I don't think @genusistimelord have either.

I don't know when I'll have time to do it. But feel free to implement it yourself

@C-Entropy
Copy link
Author

I'm willing to give it a try, but I'm very new here, do you have any suggestions?

@Ultraxime
Copy link
Collaborator

I would fork the repo, create a dev branch and change the cargo.toml to fetch the iced main branch and see what cargo complains about
And then try every example to check that nothing broke

@C-Entropy
Copy link
Author

C-Entropy commented Feb 7, 2025

When some api was broken, how to figure out what to do to fix it?
For example,to fix the missing on_event(), i searched the commit history of iced to locate which one removed it, and how files are updated.
Is this the right way? Or are there other more effect ways?

@Ultraxime
Copy link
Collaborator

I'm no part of the iced development team. I'm just a user and contributor to iced_aw so it would be my idea
Or maybe read the documentation from the development branch of iced
There should also be a change log maybe it could help

@genusistimelord
Copy link
Collaborator

yeah we do not always stay synced with Iced as during iced changes they rapidly change to often for us to keep up. So we generally wait till it is almost to the next version to start working on that. We do however Accept contributions to Push the Beta Branch towards the current Iced master.

@C-Entropy
Copy link
Author

i have make some progress on the on_event to update thing,but the iced_font is trouble me, complain something about iced_core::font and iced::font, can you take a look?

@genusistimelord
Copy link
Collaborator

genusistimelord commented Feb 7, 2025

yeah that crate also needs to be updated to the master as it uses the Iced_core Font stuff for its fonts

you can open a issue for that here
https://github.com/Redhawk18/iced_fonts

@C-Entropy
Copy link
Author

I have cloned the project and update iced_core version locally and it works fine.
I think I will just left one comment in Cargo.toml of iced_aw for easier.

@C-Entropy
Copy link
Author

C-Entropy commented Feb 8, 2025

I have try to adopt iced_aw with iced-rs/iced@940a079.
You can view it at https://github.com/C-Entropy/iced_aw/tree/beta
I can cargo run all examples, but some example like badge failed to auto change color when mouse hover.
I guess it have something to do with iced-rs/iced#2662:

This PR changes the runtime to only perform a redraw of the user interface when either an update occurs, or a widget explicitly requests it.

Can't figure out how to fix it by now, but at least it can save some works I suppose.
Do you want a PR?

@Ultraxime
Copy link
Collaborator

There used to be a method for the shell to invalidate the widget layout and one to ask for the widget to be redrawn, maybe it will solve the issue

@C-Entropy
Copy link
Author

C-Entropy commented Feb 8, 2025

I think we have to implement reactive-rendering for those widgets, but it may dive deep into the code logic, which I'm unfamiliar with.
I will keep to update the beta branch if I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants