Improved and simplified how the menus and sub-menus interact and behave.

Fixed code editor find and replace editor focus.
This commit is contained in:
Martín Lucas Golini
2020-06-23 00:16:43 -03:00
parent 78e28ccd83
commit e0a34bec5a
16 changed files with 372 additions and 455 deletions

View File

@@ -820,6 +820,7 @@ void App::showFindView() {
} else if ( !findInput->getText().empty() ) {
findInput->getDocument().selectAll();
}
mCurEditor->getDocument().setActiveClient( mCurEditor );
}
void App::closeApp() {
@@ -917,6 +918,8 @@ void App::createSettingsMenu() {
mSettingsMenu->show();
} );
mSettingsMenu->addEventListener( Event::OnItemClicked, [&]( const Event* event ) {
if ( !event->getNode()->isType( UI_TYPE_MENUITEM ) )
return;
const String& name = event->getNode()->asType<UIMenuItem>()->getText();
if ( name == "New" ) {
runCommand( "create-new" );