menu: fix silly old bug with submenu highlighting

When using the keyboard to close a submenu, its entry in the parent
window would remain highlighted when navigating to the next entry
as the menu's child was still set to that submenu's child and we
were not checking if it was still open.
This commit is contained in:
K. Lange 2023-02-15 20:26:59 +09:00
parent 436a772a8c
commit b003fe060c

View File

@ -156,7 +156,7 @@ void _menu_draw_MenuEntry_Submenu(gfx_context_t * ctx, struct MenuEntry * self,
struct MenuEntry_Submenu * _self = (struct MenuEntry_Submenu *)self;
int h = _self->hilight;
if (_self->_owner && _self->_my_child && _self->_owner->child == _self->_my_child) {
if (_self->_owner && _self->_my_child && _self->_owner->child == _self->_my_child && !_self->_my_child->closed) {
_self->hilight = 1;
}
_menu_draw_MenuEntry_Normal(ctx,self,offset);