FMenuItem accelerator fix

This commit is contained in:
Markus Gans 2017-08-24 22:58:34 +02:00
parent 3f8b9d774b
commit 12c0d53192
1 changed files with 17 additions and 14 deletions

View File

@ -595,13 +595,17 @@ void FMenuItem::onAccel (FAccelEvent* ev)
{ {
FFocusEvent out (fc::FocusOut_Event); FFocusEvent out (fc::FocusOut_Event);
FApplication::queueEvent(focused_widget, &out); FApplication::queueEvent(focused_widget, &out);
}
menu->unselectItem(); menu->unselectItem();
menu->selectFirstItem(); menu->selectFirstItem();
if ( menu->getSelectedItem() ) if ( menu->getSelectedItem() )
menu->getSelectedItem()->setFocus(); menu->getSelectedItem()->setFocus();
if ( focused_widget && focused_widget->isWidget() )
focused_widget->redraw(); focused_widget->redraw();
menu->redraw(); menu->redraw();
if ( getStatusBar() ) if ( getStatusBar() )
@ -610,7 +614,6 @@ void FMenuItem::onAccel (FAccelEvent* ev)
mbar->redraw(); mbar->redraw();
mbar->drop_down = true; mbar->drop_down = true;
} }
}
else else
{ {
unsetSelected(); unsetSelected();