Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2013-08-16 07:36:51 -0400
committerMarkus Keller2013-08-16 08:10:57 -0400
commitdc90724a67a629c2b417cb5b5e6c17d4ffd149cf (patch)
treedb0d0bf3f51f8f04a7fb0149f070595b1e6dad3f
parentb33bdb79a997eb303a0e5637b28d118b5aa68ac9 (diff)
downloadeclipse.platform.swt-dc90724a67a629c2b417cb5b5e6c17d4ffd149cf.tar.gz
eclipse.platform.swt-dc90724a67a629c2b417cb5b5e6c17d4ffd149cf.tar.xz
eclipse.platform.swt-dc90724a67a629c2b417cb5b5e6c17d4ffd149cf.zip
Bug 414957: wrong values from ScrollBar#getThumbBounds (was:
[navigation] Mark Occurrences scrollbar position doesn't match)
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java36
1 files changed, 22 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
index ff32372007..42d4527b1f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java
@@ -11,10 +11,18 @@
package org.eclipse.swt.widgets;
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.gtk.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.gtk.GdkEvent;
+import org.eclipse.swt.internal.gtk.GdkEventButton;
+import org.eclipse.swt.internal.gtk.GtkAdjustment;
+import org.eclipse.swt.internal.gtk.GtkAllocation;
+import org.eclipse.swt.internal.gtk.GtkRequisition;
+import org.eclipse.swt.internal.gtk.OS;
/**
* Instances of this class are selectable user interface
@@ -375,24 +383,24 @@ public Rectangle getThumbTrackBounds () {
int x = 0, y = 0, width, height;
int[] has_stepper = new int[1];
OS.gtk_widget_style_get (handle, OS.has_backward_stepper, has_stepper, 0);
- boolean hasA = has_stepper[0] != 0;
- OS.gtk_widget_style_get (handle, OS.has_secondary_backward_stepper, has_stepper, 0);
boolean hasB = has_stepper[0] != 0;
+ OS.gtk_widget_style_get (handle, OS.has_secondary_backward_stepper, has_stepper, 0);
+ boolean hasB2 = has_stepper[0] != 0;
OS.gtk_widget_style_get (handle, OS.has_forward_stepper, has_stepper, 0);
- boolean hasC = has_stepper[0] != 0;
+ boolean hasF = has_stepper[0] != 0;
OS.gtk_widget_style_get (handle, OS.has_secondary_forward_stepper, has_stepper, 0);
- boolean hasD = has_stepper[0] != 0;
+ boolean hasF2 = has_stepper[0] != 0;
GtkAllocation allocation = new GtkAllocation ();
gtk_widget_get_allocation (handle, allocation);
if ((style & SWT.VERTICAL) != 0) {
int stepperSize = allocation.width;
x = allocation.x;
- if (hasA) y += stepperSize;
if (hasB) y += stepperSize;
+ if (hasF2) y += stepperSize;
width = allocation.width;
height = allocation.height - y;
- if (hasC) height -= stepperSize;
- if (hasD) height -= stepperSize;
+ if (hasB2) height -= stepperSize;
+ if (hasF) height -= stepperSize;
if (height < 0) {
int [] slider_start = new int [1], slider_end = new int [1];
gtk_range_get_slider_range (handle, slider_start, slider_end);
@@ -401,12 +409,12 @@ public Rectangle getThumbTrackBounds () {
}
} else {
int stepperSize = allocation.height;
- if (hasA) x += stepperSize;
if (hasB) x += stepperSize;
+ if (hasF2) x += stepperSize;
y = allocation.y;
width = allocation.width -x;
- if (hasC) width -= stepperSize;
- if (hasD) width -= stepperSize;
+ if (hasB2) width -= stepperSize;
+ if (hasF) width -= stepperSize;
height = allocation.height;
if (width < 0) {
int [] slider_start = new int [1], slider_end = new int [1];

Back to the top