summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
diff options
context:
space:
mode:
authorFelipe Heidrich <Felipe_Heidrich@ca.ibm.com>2011-10-19 11:06:54 -0400
committerFelipe Heidrich <Felipe_Heidrich@ca.ibm.com>2011-10-19 11:06:54 -0400
commite4feb6ecfa8a7c1734706e67f08b96b0a522620c (patch)
tree44654e2d0bb54037876ef75841e314522b48925c /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets
parente87c984b75c4897139f3db73d707bcbc49b0c3ce (diff)
downloadeclipse.platform.swt-e4feb6ecfa8a7c1734706e67f08b96b0a522620c.tar.gz
eclipse.platform.swt-e4feb6ecfa8a7c1734706e67f08b96b0a522620c.tar.xz
eclipse.platform.swt-e4feb6ecfa8a7c1734706e67f08b96b0a522620c.zip
Bug 361292 - StyledText horizontal scroll bar doesn't scroll to the end of line
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java37
1 files changed, 24 insertions, 13 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
index 852816035f..991f887a3b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -6132,19 +6132,7 @@ void handleResize(Event event) {
clientAreaWidth = clientArea.width;
if (!alwaysShowScroll && ignoreResize != 0) return;
- /* Redraw the old or new right/bottom margin if needed */
- if (oldWidth != clientAreaWidth) {
- if (rightMargin > 0) {
- int x = (oldWidth < clientAreaWidth ? oldWidth : clientAreaWidth) - rightMargin;
- super.redraw(x, 0, rightMargin, oldHeight, false);
- }
- }
- if (oldHeight != clientAreaHeight) {
- if (bottomMargin > 0) {
- int y = (oldHeight < clientAreaHeight ? oldHeight : clientAreaHeight) - bottomMargin;
- super.redraw(0, y, oldWidth, bottomMargin, false);
- }
- }
+ redrawMargins(oldHeight, oldWidth);
if (wordWrap) {
if (oldWidth != clientAreaWidth) {
renderer.reset(0, content.getLineCount());
@@ -7433,6 +7421,21 @@ void redrawLinesBullet (int[] redrawLines) {
super.redraw(0, y, width, height, false);
}
}
+void redrawMargins(int oldHeight, int oldWidth) {
+ /* Redraw the old or new right/bottom margin if needed */
+ if (oldWidth != clientAreaWidth) {
+ if (rightMargin > 0) {
+ int x = (oldWidth < clientAreaWidth ? oldWidth : clientAreaWidth) - rightMargin;
+ super.redraw(x, 0, rightMargin, oldHeight, false);
+ }
+ }
+ if (oldHeight != clientAreaHeight) {
+ if (bottomMargin > 0) {
+ int y = (oldHeight < clientAreaHeight ? oldHeight : clientAreaHeight) - bottomMargin;
+ super.redraw(0, y, oldWidth, bottomMargin, false);
+ }
+ }
+}
/**
* Redraws the specified text range.
*
@@ -9328,6 +9331,8 @@ void setScrollBars(boolean vertical) {
if (!isFixedLineHeight() || !alwaysShowScroll) vertical = true;
ScrollBar verticalBar = vertical ? getVerticalBar() : null;
ScrollBar horizontalBar = getHorizontalBar();
+ int oldHeight = clientAreaHeight;
+ int oldWidth = clientAreaWidth;
if (!alwaysShowScroll) {
if (verticalBar != null) verticalBar.setVisible(false);
if (horizontalBar != null) horizontalBar.setVisible(false);
@@ -9339,8 +9344,14 @@ void setScrollBars(boolean vertical) {
setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
if (!alwaysShowScroll && horizontalBar.getVisible() && verticalBar != null) {
setScrollBar(verticalBar, clientAreaHeight, renderer.getHeight(), topMargin + bottomMargin);
+ if (verticalBar.getVisible()) {
+ setScrollBar(horizontalBar, clientAreaWidth, renderer.getWidth(), leftMargin + rightMargin);
+ }
}
}
+ if (!alwaysShowScroll) {
+ redrawMargins(oldHeight, oldWidth);
+ }
ignoreResize--;
}
/**