| 1438 | } |
| 1439 | |
| 1440 | void 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 | |
| 1478 | void UICodeEditorSplitter::closeTabWidgets( UISplitter* splitter ) { |
| 1479 | Node* node = splitter->getFirstChild(); |
nothing calls this directly
no test coverage detected