|
Lines 157-162
Link Here
|
| 157 |
int bottomOffset= clArea.y + clArea.height - scrollbarHeight; |
157 |
int bottomOffset= clArea.y + clArea.height - scrollbarHeight; |
| 158 |
int[] arrowHeights= getVerticalScrollArrowHeights(textWidget, bottomOffset); |
158 |
int[] arrowHeights= getVerticalScrollArrowHeights(textWidget, bottomOffset); |
| 159 |
|
159 |
|
|
|
160 |
/* |
| 161 |
* Goal: Center of thumb should align with center of line mark in overview ruler. |
| 162 |
*/ |
| 163 |
|
| 164 |
// //TODO: should move this into the painter in OverviewRuler |
| 165 |
// |
| 166 |
// ScrollBar verticalBar= textWidget.getVerticalBar(); |
| 167 |
// double thumbTrackHeight= verticalBar.getThumbTrackBounds().height; |
| 168 |
// double thumbHeight= verticalBar.getThumbBounds().height; |
| 169 |
// double textLineCount= Math.max(1, textWidget.getLineCount()); |
| 170 |
// int topIndex= textWidget.getTopIndex(); |
| 171 |
// Rectangle clientArea= textWidget.getClientArea(); |
| 172 |
// int bottomIndex= textWidget.getLineIndex(clientArea.y + clientArea.height); |
| 173 |
// double visibleLineCount= bottomIndex - topIndex + 1; |
| 174 |
// // (thumbHeight-additionalThumbHeight)/thumbTrackHeight == visibleLineCount/textLineCount: |
| 175 |
// double additionalThumbHeight= Math.max(0, thumbHeight - visibleLineCount/textLineCount*thumbTrackHeight); |
| 176 |
// |
| 177 |
// //TODO: |
| 178 |
//// System.out.println(additionalThumbHeight); |
| 179 |
//// fOverviewRuler.getControl().setBackground(fOverviewRuler.getControl().getDisplay().getSystemColor(SWT.COLOR_GREEN)); |
| 180 |
// |
| 181 |
// int overviewRulerX= clArea.x + clArea.width - overviewRulerWidth - 1; |
| 182 |
// int overviewRulerY= (int)(clArea.y + arrowHeights[0] + additionalThumbHeight/2d); |
| 183 |
// int overviewRulerHeight= (int)(clArea.height - arrowHeights[0] - arrowHeights[1] - additionalThumbHeight - scrollbarHeight); |
| 184 |
// fOverviewRuler.getControl().setBounds(overviewRulerX, overviewRulerY, overviewRulerWidth, overviewRulerHeight); |
| 185 |
|
| 160 |
int overviewRulerX= clArea.x + clArea.width - overviewRulerWidth - 1; |
186 |
int overviewRulerX= clArea.x + clArea.width - overviewRulerWidth - 1; |
| 161 |
fOverviewRuler.getControl().setBounds(overviewRulerX, clArea.y + arrowHeights[0], overviewRulerWidth, clArea.height - arrowHeights[0] - arrowHeights[1] - scrollbarHeight); |
187 |
fOverviewRuler.getControl().setBounds(overviewRulerX, clArea.y + arrowHeights[0], overviewRulerWidth, clArea.height - arrowHeights[0] - arrowHeights[1] - scrollbarHeight); |
| 162 |
|
188 |
|
|
Lines 205-211
Link Here
|
| 205 |
} finally { |
231 |
} finally { |
| 206 |
textWidget.setSize(originalSize); // also resets scroll bar values |
232 |
textWidget.setSize(originalSize); // also resets scroll bar values |
| 207 |
} |
233 |
} |
| 208 |
return arrowHeights; |
|
|
| 209 |
} |
234 |
} |
| 210 |
return arrowHeights; |
235 |
return arrowHeights; |
| 211 |
} |
236 |
} |