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

Menu rewrite #209

Merged
merged 43 commits into from
Feb 24, 2024
Merged

Menu rewrite #209

merged 43 commits into from
Feb 24, 2024

Conversation

latidoremi
Copy link
Contributor

Fix #196

Complete rewrite of the menu widget

MenuTree is now divided into Item and Menu, since widgets have to be wrapped inside menu tree nodes and most items won't have a submenu, wrapping with Item only costs each widget one extra pointer

New helper macros: menu_item, menu, menu_bar, details are in the docs

Menu bar background styling

Mouse interaction is now implemented

Rename PathHighlight to DrawPath, a FakeHovering variant is added, details are in the docs

ItemWidth and ItemHeight are removed, static width and dynamic height should suffice, other options can be easily implemented by the lib users

Todos:

  • CloseCondition
  • Multioverlay

I'm a bit tired working on this rewrite, I'll come back to the todos later, but I need to take break for now

@genusistimelord can you test it and see if there are bugs I didn't catch, if there are't any you can merge it now

Btw I have to comment out this

[workspace]
members = [
    ...
    # "examples/floating_element multioverlay",
    ...

for some reason cargo won't compile the menu example if I don't

Copy link
Collaborator

@genusistimelord genusistimelord left a comment

Choose a reason for hiding this comment

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

Testing it as we speak.

@genusistimelord
Copy link
Collaborator

yeah the example Errors because I forgot to upload the folder. I did that just now so it should work now and you need to merge those into this.

@genusistimelord
Copy link
Collaborator

genusistimelord commented Feb 23, 2024

OK I see a few issues with the Scroller menu.

1: When Selecting the jcsu button the popup menu cuts itself off at the top and only works when it finally detects the jcsu button is paste half way and displays it below.
2: The scrolling of the inner menu causes the button/label to scrunch rather than scroll.
image
3: the scrollbars are not visible for direct scrolling and it is Very slow to scroll via middle mouse button.

You will also need to run cargo fmt and cargo clippy and fix all the issues too.

Other than those everything else looks good.

@Redhawk18
Copy link
Contributor

You guys are real ones

@latidoremi
Copy link
Contributor Author

OK I see a few issues with the Scroller menu.

1: When Selecting the jcsu button the popup menu cuts itself off at the top and only works when it finally detects the jcsu button is paste half way and displays it below. 2: The scrolling of the inner menu causes the button/label to scrunch rather than scroll. image 3: the scrollbars are not visible for direct scrolling and it is Very slow to scroll via middle mouse button.

You will also need to run cargo fmt and cargo clippy and fix all the issues too.

Other than those everything else looks good.

1: Fixed

2:This is the expected behavior atm, the algorithm simply clips whatever that is not visible, it does not know where the clipping happens, and it scales the layouts at the two ends to fit the space, one benefit is that it keeps the content in the middle so when a tall widget gets clipped the text stays in the middle. I can fix that but it'll take some time

3:Scroll speed added, scrollbar was not planned, I can do it but again it'll take some time, I have to save it for later

Those fmt and clippy issues come from floating element and tabs, should I fix them?

@genusistimelord
Copy link
Collaborator

yes please fix the clippy issues and fmt issues.

@latidoremi
Copy link
Contributor Author

Ok on second thought the scaling does look stupid it's now fixed

@genusistimelord
Copy link
Collaborator

thank you for all your hard work =D. Also thank you for fixing the scaling XD

@genusistimelord genusistimelord merged commit e027264 into iced-rs:main Feb 24, 2024
2 checks passed
@justDeeevin
Copy link

LFG!!

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

Successfully merging this pull request may close these issues.

Beta Update to latest Iced Master
4 participants