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

Method updateLocateBarSync

src/tools/ecode/universallocator.cpp:584–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void 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
607void UniversalLocator::updateLocateBar() {
608 mLocateBarLayout->runOnMainThread( [this] { updateLocateBarSync(); } );

Callers

nothing calls this directly

Calls 13

setColumnsVisibleMethod · 0.80
getColumnWidthMethod · 0.80
convertToWorldSpaceMethod · 0.80
setPixelsPositionMethod · 0.80
getWidthMethod · 0.45
getPixelsSizeMethod · 0.45
setPixelsSizeMethod · 0.45
getRowHeightMethod · 0.45
getVerticalScrollBarMethod · 0.45
getModelMethod · 0.45
columnCountMethod · 0.45
setColumnWidthMethod · 0.45

Tested by

no test coverage detected