summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
diff options
context:
space:
mode:
authorSteve Northover <steve>2004-10-14 21:56:47 +0000
committerSteve Northover <steve>2004-10-14 21:56:47 +0000
commitbb4bcf269d79e4bbfbecea2088c8afbce7fcac2e (patch)
tree7d88c562e955d2f545648c705007c968799f05ed /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
parentec4463e5809457fec0c4e8fa95d96c7900df01c5 (diff)
downloadeclipse.platform.swt-bb4bcf269d79e4bbfbecea2088c8afbce7fcac2e.tar.gz
eclipse.platform.swt-bb4bcf269d79e4bbfbecea2088c8afbce7fcac2e.tar.xz
eclipse.platform.swt-bb4bcf269d79e4bbfbecea2088c8afbce7fcac2e.zip
fix extra layout when moved
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
index 7478059d2e..345b61ff32 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java
@@ -383,7 +383,7 @@ void setBackgroundColor (GdkColor color) {
if (imageHandle != 0) setBackgroundColor(imageHandle, color);
}
-boolean setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
+int setBounds (int x, int y, int width, int height, boolean move, boolean resize) {
/*
* Bug in GTK. For some reason, when the label is
* wrappable and its container is resized, it does not
@@ -398,7 +398,7 @@ boolean setBounds (int x, int y, int width, int height, boolean move, boolean re
*/
boolean fixWrap = resize && labelHandle != 0 && (style & SWT.WRAP) != 0;
if (fixWrap) OS.gtk_widget_set_size_request (labelHandle, -1, -1);
- boolean changed = super.setBounds (x, y, width, height, move, resize);
+ int result = super.setBounds (x, y, width, height, move, resize);
/*
* Bug in GTK. For some reason, when the label is
* wrappable and its container is resized, it does not
@@ -410,7 +410,7 @@ boolean setBounds (int x, int y, int width, int height, boolean move, boolean re
* This part of the fix forces the label to be
* resized so that it will draw wrapped.
*/
- if (fixWrap) {
+ if (fixWrap && (result & RESIZED) != 0) {
int labelWidth = OS.GTK_WIDGET_WIDTH (handle);
int labelHeight = OS.GTK_WIDGET_HEIGHT (handle);
OS.gtk_widget_set_size_request (labelHandle, labelWidth, labelHeight);
@@ -418,7 +418,7 @@ boolean setBounds (int x, int y, int width, int height, boolean move, boolean re
GtkRequisition requisition = new GtkRequisition ();
OS.gtk_widget_size_request (widgetHandle, requisition);
}
- return changed;
+ return result;
}
void setFontDescription (int /*long*/ font) {