Skip to content

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