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

Menubar menu header hover open #679

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dodzey
Copy link

@Dodzey Dodzey commented Sep 1, 2024

Support switching menu by hovering over menubar headers while a menu is active. This matches typical menu bar behaviour in most GUIs.

2024-09-01 20 16 59

@Dodzey
Copy link
Author

Dodzey commented Sep 1, 2024

There is one small downside with my current approach, If I set the window containing the menubar to NK_WINDOW_BACKGROUND, and overlap the menubar item headers with another window etc, then I can still activate them. I'm not sure there is a way to get NK_WIDGET_STATE_HOVER from the header button (ctx->last_widget_state after it is processed) as the popup window seems to stop those state flags being set - which makes sense I guess - but means the direct mouse rect test is the only way I can think to do this?

This is probably not a particularly common use case though - typically a menubar will be at the top of a window, or drawn at the top of the application as a window with no borders etc I would imagine.

@Dodzey Dodzey marked this pull request as draft September 6, 2024 20:18
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.

1 participant