diff options
author | Silenio Quarti <silenio> | 2002-09-23 18:20:35 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2002-09-23 18:20:35 +0000 |
commit | a451dc214bba50d97c6abedad7c3818b3edad040 (patch) | |
tree | ae6742fe31c65af69313557daf8d6d61577260ba | |
parent | 0a46f8c0a3d9fd1f9abd5b1e6d493c44cad4e7d2 (diff) | |
download | eclipse.platform.swt-a451dc214bba50d97c6abedad7c3818b3edad040.tar.gz eclipse.platform.swt-a451dc214bba50d97c6abedad7c3818b3edad040.tar.xz eclipse.platform.swt-a451dc214bba50d97c6abedad7c3818b3edad040.zip |
*** empty log message ***
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java | 9 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java | 12 |
2 files changed, 6 insertions, 15 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java index a84e9dbe33..37ca32bf12 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java @@ -499,12 +499,13 @@ public void setImage (Image image) { checkWidget (); this.image = image; if ((style & SWT.ARROW) != 0) return; - OS.gtk_widget_hide (labelHandle); if (image != null) { OS.gtk_image_set_from_pixmap (imageHandle, image.pixmap, image.mask); + OS.gtk_widget_hide (labelHandle); OS.gtk_widget_show (imageHandle); } else { OS.gtk_image_set_from_pixmap (imageHandle, 0, 0); + OS.gtk_widget_show (labelHandle); OS.gtk_widget_hide (imageHandle); } /* @@ -566,11 +567,7 @@ public void setText (String string) { byte [] buffer = Converter.wcsToMbcs (null, chars, false); OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); OS.gtk_widget_hide (imageHandle); - if (string.length () != 0) { - OS.gtk_widget_show (labelHandle); - } else { - OS.gtk_widget_hide (labelHandle); - } + OS.gtk_widget_show (labelHandle); /* * Bug in GTK. For some reason, the button does not allocate the size of its internal * children if its bounds is set before the image is set. The fix is to force this by calling 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 9941f56167..19a94798ce 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 @@ -116,9 +116,6 @@ public Point computeSize (int wHint, int hHint, boolean changed) { } if (labelHandle != 0) { OS.gtk_widget_set_size_request (labelHandle, labelWidth, labelHeight); - if (text.length () == 0 && OS.GTK_WIDGET_VISIBLE (labelHandle)) { - requisition.height += fontHeight (getFontDescription (), labelHandle); - } } OS.gtk_widget_set_size_request (handle, width, height); return new Point (requisition.width, requisition.height); @@ -442,12 +439,13 @@ public void setImage (Image image) { checkWidget (); this.image = image; if ((style & SWT.SEPARATOR) != 0) return; - OS.gtk_widget_hide (labelHandle); if (image != null) { OS.gtk_image_set_from_pixmap (imageHandle, image.pixmap, image.mask); + OS.gtk_widget_hide (labelHandle); OS.gtk_widget_show (imageHandle); } else { OS.gtk_image_set_from_pixmap (imageHandle, 0, 0); + OS.gtk_widget_show (labelHandle); OS.gtk_widget_hide (imageHandle); } } @@ -478,11 +476,7 @@ public void setText (String string) { byte [] buffer = Converter.wcsToMbcs (null, chars, false); OS.gtk_label_set_text_with_mnemonic (labelHandle, buffer); OS.gtk_widget_hide (imageHandle); - if (string.length () != 0) { - OS.gtk_widget_show (labelHandle); - } else { - OS.gtk_widget_hide (labelHandle); - } + OS.gtk_widget_show (labelHandle); } } |