edit
edit copied to clipboard
feat: toggle menus on click
Closes #80
menus now close when their button is clicked again
we track which menu button opened through menubar_toggle_id field on Tui. When a menu button is clicked and its ID matches the stored toggle ID, focus is popped to close the menu
Then, the toggle ID is only set after the mouse is released, so that we avoid situations where first click immediately triggers the close
It's cleared when focus leaves the menubar entirely