MCPcopy Create free account
hub / github.com/SpartanJ/eepp / focusSomeEditor

Method focusSomeEditor

src/eepp/ui/tools/uicodeeditorsplitter.cpp:1440–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440void UICodeEditorSplitter::focusSomeEditor( Node* searchFrom ) {
1441 UICodeEditor* editor =
1442 searchFrom && searchFrom->isType( UI_TYPE_CODEEDITOR )
1443 ? searchFrom->findByType<UICodeEditor>( UI_TYPE_CODEEDITOR )
1444 : ( mBaseLayout ? mBaseLayout->findByType<UICodeEditor>( UI_TYPE_CODEEDITOR )
1445 : nullptr );
1446
1447 UITabWidget* tabW = nullptr;
1448 if ( editor && editor->getParent() && editor->getParent()->getParent() &&
1449 editor->getParent()->getParent()->isType( UI_TYPE_TABWIDGET ) &&
1450 ( tabW = tabWidgetFromEditor( editor ) ) && !tabW->isClosing() &&
1451 tabW->getTabCount() > 1 ) {
1452 if ( tabW && ( tabW->getTabSelected()->getOwnedWidget() != editor ||
1453 ( searchFrom == nullptr && editor != nullptr ) ) ) {
1454 tabW->setTabSelected( tabW->getTabSelected() );
1455 return;
1456 } else if ( tabW ) {
1457 for ( size_t i = 0; i < tabW->getTabCount(); ++i ) {
1458 if ( tabW->getTab( i )->getOwnedWidget() != editor ) {
1459 tabW->setTabSelected( i );
1460 return;
1461 }
1462 }
1463 }
1464 }
1465
1466 for ( auto widget : mTabWidgets ) {
1467 if ( !widget->isClosing() && widget->getTabCount() > 0 ) {
1468 if ( widget->getTabSelected() != nullptr ) {
1469 widget->setTabSelected( widget->getTabSelected() );
1470 } else {
1471 widget->setTabSelected( (Uint32)0 );
1472 }
1473 return;
1474 }
1475 }
1476}
1477
1478void UICodeEditorSplitter::closeTabWidgets( UISplitter* splitter ) {
1479 Node* node = splitter->getFirstChild();

Callers

nothing calls this directly

Calls 8

getTabCountMethod · 0.80
getOwnedWidgetMethod · 0.80
getTabSelectedMethod · 0.80
isTypeMethod · 0.45
getParentMethod · 0.45
isClosingMethod · 0.45
setTabSelectedMethod · 0.45
getTabMethod · 0.45

Tested by

no test coverage detected