mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Fix a focusing issue when moving a terminal to the status bar terminal, hiding the terminal would not focus any editor.
This commit is contained in:
@@ -517,6 +517,19 @@ void UICodeEditorSplitter::setCurrentEditor( UICodeEditor* editor ) {
|
||||
}
|
||||
|
||||
void UICodeEditorSplitter::setCurrentWidget( UIWidget* curWidget ) {
|
||||
if ( curWidget == nullptr ) {
|
||||
if ( mCurEditor ) {
|
||||
mCurWidget = mCurEditor;
|
||||
mClient->onWidgetFocusChange( curWidget );
|
||||
} else {
|
||||
// Should never happen: curWidget == nullptr is passed when a terminal is moved outside
|
||||
// the splitter
|
||||
auto editor = getSomeEditor();
|
||||
if ( editor )
|
||||
setCurrentWidget( editor );
|
||||
}
|
||||
return;
|
||||
}
|
||||
if ( curWidget->isType( UI_TYPE_CODEEDITOR ) ) {
|
||||
setCurrentEditor( curWidget->asType<UICodeEditor>() );
|
||||
return;
|
||||
|
||||
@@ -555,6 +555,11 @@ UITerminal* TerminalManager::createNewTerminal(
|
||||
ret.first->setIcon( mApp->findIcon( "filetype-bash" ) );
|
||||
mApp->getSplitter()->removeUnusedTab( tabWidget, true, false );
|
||||
|
||||
term->removeEventsOfType( Event::OnFocus );
|
||||
term->on( Event::OnFocus, [this, term]( const Event* ) {
|
||||
mApp->getSplitter()->setCurrentWidget(
|
||||
mApp->getSplitter()->getBaseLayout()->inParentTreeOf( term ) ? term : nullptr );
|
||||
} );
|
||||
term->setTitle( title );
|
||||
auto csIt = mTerminalColorSchemes.find( mTerminalCurrentColorScheme );
|
||||
term->getTerm()->getTerminal()->setAllowMemoryTrimnming( true );
|
||||
|
||||
Reference in New Issue
Block a user