| 582 | } |
| 583 | |
| 584 | void UniversalLocator::updateLocateBarSync() { |
| 585 | Float width = eeceil( mLocateInput->getPixelsSize().getWidth() ); |
| 586 | mLocateTable->setPixelsSize( width, |
| 587 | mLocateTable->getRowHeight() * LOCATEBAR_MAX_VISIBLE_ITEMS ); |
| 588 | width -= mLocateTable->getVerticalScrollBar()->getPixelsSize().getWidth(); |
| 589 | if ( mLocateTable->getModel() && mLocateTable->getModel()->columnCount() >= 3 ) { |
| 590 | mLocateTable->setColumnsVisible( { 0, 1, 2 } ); |
| 591 | mLocateTable->setColumnWidth( 0, eefloor( width * 0.5 ) ); |
| 592 | mLocateTable->setColumnWidth( 1, eefloor( width * 0.25 ) ); |
| 593 | mLocateTable->setColumnWidth( 2, eefloor( width * 0.25 ) ); |
| 594 | } else if ( mLocateTable->getModel() && mLocateTable->getModel()->columnCount() >= 2 ) { |
| 595 | mLocateTable->setColumnsVisible( { 0, 1 } ); |
| 596 | mLocateTable->setColumnWidth( 0, eeceil( width * 0.5 ) ); |
| 597 | mLocateTable->setColumnWidth( 1, width - mLocateTable->getColumnWidth( 0 ) ); |
| 598 | } else { |
| 599 | mLocateTable->setColumnsVisible( { 0 } ); |
| 600 | mLocateTable->setColumnWidth( 0, width ); |
| 601 | } |
| 602 | Vector2f pos( mLocateInput->convertToWorldSpace( { 0, 0 } ) ); |
| 603 | pos.y -= mLocateTable->getPixelsSize().getHeight(); |
| 604 | mLocateTable->setPixelsPosition( pos ); |
| 605 | } |
| 606 | |
| 607 | void UniversalLocator::updateLocateBar() { |
| 608 | mLocateBarLayout->runOnMainThread( [this] { updateLocateBarSync(); } ); |
nothing calls this directly
no test coverage detected