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

Method updateGlobalSearchBar

src/tools/ecode/globalsearchcontroller.cpp:656–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void 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
674void GlobalSearchController::hideGlobalSearchBar() {
675 mGlobalSearchBarLayout->setEnabled( false )->setVisible( false );

Callers

nothing calls this directly

Calls 13

runOnMainThreadMethod · 0.80
convertToWorldSpaceMethod · 0.80
setLayoutMarginLeftMethod · 0.80
setLayoutMarginTopMethod · 0.80
getWidthMethod · 0.45
getPixelsSizeMethod · 0.45
getRowHeightMethod · 0.45
setPixelsSizeMethod · 0.45
getVerticalScrollBarMethod · 0.45
setColumnWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected