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

Method drawLockedIcon

src/eepp/ui/uicodeeditor.cpp:1146–1168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146void UICodeEditor::drawLockedIcon( const Vector2f start ) {
1147 if ( mFileLockIcon == nullptr && !mFileLockIconName.empty() )
1148 mFileLockIcon = getUISceneNode()->findIcon( mFileLockIconName );
1149 if ( mFileLockIcon == nullptr )
1150 return;
1151
1152 Drawable* fileLockIcon = mFileLockIcon->getSize( PixelDensity::dpToPxI( 16 ) );
1153 if ( fileLockIcon == nullptr )
1154 return;
1155
1156 Float w = fileLockIcon->getPixelsSize().getWidth();
1157 Float posX =
1158 mMinimapEnabled
1159 ? getMinimapRect( getScreenStart() ).Left - w
1160 : ( start.x + mSize.getWidth() -
1161 ( mVScrollBar->isVisible() ? mVScrollBar->getPixelsSize().getWidth() : 0 ) ) -
1162 mPadding.Right - w;
1163 Color col( fileLockIcon->getColor() );
1164 fileLockIcon->setColor( Color( mFontStyleConfig.getFontColor() ).blendAlpha( mAlpha ) );
1165 Float margin = PixelDensity::dpToPxI( 4 );
1166 fileLockIcon->draw( { posX - margin, start.y + margin } );
1167 fileLockIcon->setColor( col );
1168}
1169
1170size_t UICodeEditor::getTotalVisibleLines() const {
1171 return mDocView.getVisibleLinesCount();

Callers

nothing calls this directly

Calls 9

emptyMethod · 0.45
findIconMethod · 0.45
getSizeMethod · 0.45
getWidthMethod · 0.45
getPixelsSizeMethod · 0.45
isVisibleMethod · 0.45
getColorMethod · 0.45
setColorMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected