| 2135 | } |
| 2136 | |
| 2137 | void UICodeEditor::updateScrollBar() { |
| 2138 | Int64 notVisibleLineCount = (Int64)getTotalVisibleLines() - (Int64)getViewPortLineCount().y; |
| 2139 | |
| 2140 | mHScrollBar->setEnabled( false ); |
| 2141 | mHScrollBar->setVisible( false ); |
| 2142 | |
| 2143 | mVScrollBar->setPixelsSize( mVScrollBar->getPixelsSize().getWidth(), editorHeight() ); |
| 2144 | |
| 2145 | if ( mHorizontalScrollBarEnabled ) { |
| 2146 | mHScrollBar->setPixelsPosition( mPaddingPx.Left, |
| 2147 | mSize.getHeight() - mPaddingPx.Bottom - |
| 2148 | mHScrollBar->getPixelsSize().getHeight() ); |
| 2149 | mHScrollBar->setPixelsSize( editorWidth() - |
| 2150 | ( mVerticalScrollBarEnabled && notVisibleLineCount > 0 |
| 2151 | ? mVScrollBar->getPixelsSize().getWidth() |
| 2152 | : 0 ), |
| 2153 | mHScrollBar->getPixelsSize().getHeight() ); |
| 2154 | Float viewPortWidth = getViewportWidth(); |
| 2155 | mHScrollBar->setPageStep( viewPortWidth / mLongestLineWidth ); |
| 2156 | mHScrollBar->setClickStep( 0.2f ); |
| 2157 | bool showHScroll = mLongestLineWidth > viewPortWidth && !mDocView.isWrapEnabled(); |
| 2158 | mHScrollBar->setEnabled( showHScroll ); |
| 2159 | mHScrollBar->setVisible( showHScroll ); |
| 2160 | } |
| 2161 | |
| 2162 | mVScrollBar->setPixelsPosition( mSize.getWidth() - mVScrollBar->getPixelsSize().getWidth(), |
| 2163 | mPaddingPx.Top ); |
| 2164 | mVScrollBar->setPageStep( getViewPortLineCount().y / (float)mDocView.getVisibleLinesCount() ); |
| 2165 | mVScrollBar->setClickStep( 0.2f ); |
| 2166 | bool wasVScrollVisible = mVScrollBar->isVisible(); |
| 2167 | bool showVScroll = mVerticalScrollBarEnabled && notVisibleLineCount > 0; |
| 2168 | mVScrollBar->setEnabled( showVScroll ); |
| 2169 | mVScrollBar->setVisible( showVScroll ); |
| 2170 | |
| 2171 | if ( wasVScrollVisible != showVScroll && mDocView.isWrapEnabled() ) |
| 2172 | invalidateLineWrapMaxWidth( false ); |
| 2173 | |
| 2174 | setScrollY( mScroll.y ); |
| 2175 | } |
| 2176 | |
| 2177 | void UICodeEditor::goToLine( const TextPosition& position, bool centered, bool forceExactPosition, |
| 2178 | bool scrollX ) { |
nothing calls this directly
no test coverage detected