| 654 | } |
| 655 | |
| 656 | void GlobalSearchController::updateGlobalSearchBar() { |
| 657 | mGlobalSearchBarLayout->runOnMainThread( [this] { |
| 658 | Float width = eeceil( mGlobalSearchInput->getPixelsSize().getWidth() ); |
| 659 | Float rowHeight = mGlobalSearchTree->getRowHeight() * LOCATEBAR_MAX_VISIBLE_ITEMS; |
| 660 | mGlobalSearchLayout->setPixelsSize( width, 0 ); |
| 661 | mGlobalSearchTree->setPixelsSize( width, rowHeight ); |
| 662 | width -= mGlobalSearchTree->shouldVerticalScrollBeVisible() |
| 663 | ? mGlobalSearchTree->getVerticalScrollBar()->getPixelsSize().getWidth() |
| 664 | : 0; |
| 665 | mGlobalSearchTree->setColumnWidth( 0, eeceil( width ) ); |
| 666 | Vector2f pos( mGlobalSearchInput->convertToWorldSpace( { 0, 0 } ) ); |
| 667 | pos = PixelDensity::pxToDp( pos ); |
| 668 | mGlobalSearchLayout->setLayoutMarginLeft( pos.x ); |
| 669 | mGlobalSearchLayout->setLayoutMarginTop( pos.y - |
| 670 | mGlobalSearchLayout->getSize().getHeight() ); |
| 671 | } ); |
| 672 | } |
| 673 | |
| 674 | void GlobalSearchController::hideGlobalSearchBar() { |
| 675 | mGlobalSearchBarLayout->setEnabled( false )->setVisible( false ); |
nothing calls this directly
no test coverage detected