Clicking an already-open menu bar entry now closes the popup.
This commit is contained in:
parent
e4b44d08c1
commit
6a4044d0d7
1 changed files with 4 additions and 1 deletions
|
|
@ -983,7 +983,10 @@ static void dispatchEvents(AppContextT *ctx) {
|
||||||
MenuT *menu = &win->menuBar->menus[i];
|
MenuT *menu = &win->menuBar->menus[i];
|
||||||
|
|
||||||
if (relX >= menu->barX && relX < menu->barX + menu->barW) {
|
if (relX >= menu->barX && relX < menu->barX + menu->barW) {
|
||||||
if (i != ctx->popup.menuIdx || ctx->popup.depth > 0) {
|
if ((buttons & 1) && !(prevBtn & 1) && i == ctx->popup.menuIdx && ctx->popup.depth == 0) {
|
||||||
|
// Clicking the same menu bar entry closes the menu
|
||||||
|
closeAllPopups(ctx);
|
||||||
|
} else if (i != ctx->popup.menuIdx || ctx->popup.depth > 0) {
|
||||||
openPopupAtMenu(ctx, win, i);
|
openPopupAtMenu(ctx, win, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue