-
Notifications
You must be signed in to change notification settings - Fork 116
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
Impl ContextMenu #139
Impl ContextMenu #139
Conversation
bug: on_press button not trigger in overlay
Ok so in order for this to work Correctly as a right click anywhere menu you will need to remove the underlay portion from context menu. I think you can do this by making it take a Screen height and width and in the layout using that as its height and width. Then I believe Event will trigger allowing you to do right click anywhere within the size. Probably should make the underlay Optional actually as this might be better for those who just want to create a screen right click area. Looks like we may also need to Create a 2nd widget that could be called Screen. Where the first set of widgets inside of it are not layout bound somehow and the 2nd set are layout bound. Allowing us to click anywhere even over other widgets. But this will be difficult to do i believe. |
you mean if we combine menu and context menu ?
why ?
but the event is not propagated through the app. We could make a method And sorry but I don't understand why we need to click over other widgets ? |
well no I mean atm you are tied to the underlays position for a rigth click window. which is OK if you only want to give options of right click to certain things within a underlay. It would be nice if this could just be added and not count towards the Layout and just take right click events but this would require a special kind of change in iced. but the current method can work. we can merge this once cargo fmt is ran on the source. |
I'm not sure I have enough knowledge of Iced to understand this approach. Maybe a start of api will help me. I finished formatting everything. |
if you type only "cargo fmt" and nothing else it should format the entire project including anything that was missed. |
I guess I just lost 30 minutes 😄 |
it is a good learning Experience. You could always join the discord and ask for help on these things too. |
This pull request implement #133.
I think this widget could be improved in the future by adapting menu to be used as overlay (only one tree of course not the entire bar).
The overlay appears at the place where the right click was made but apart from that, the implementation is quit naive and does not take into account the available space. But the menu have already this behaviour.