| 1144 | } |
| 1145 | |
| 1146 | void 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 | |
| 1170 | size_t UICodeEditor::getTotalVisibleLines() const { |
| 1171 | return mDocView.getVisibleLinesCount(); |