summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2005-12-21 23:01:18 +0000
committerSteve Northover <steve>2005-12-21 23:01:18 +0000
commitcb44d9b0bf69852d09ad1a722f90a58a908bde1d (patch)
tree324b25521d920df20f1f452d39a5621e17fe6ab6
parent0f32525f57d02359ecc071669a406f77bd4cf69b (diff)
downloadeclipse.platform.swt-cb44d9b0bf69852d09ad1a722f90a58a908bde1d.tar.gz
eclipse.platform.swt-cb44d9b0bf69852d09ad1a722f90a58a908bde1d.tar.xz
eclipse.platform.swt-cb44d9b0bf69852d09ad1a722f90a58a908bde1d.zip
120954 - Background of Control with SWT.INHERIT_FORCE doesn't show through with ToolItems with transparent images
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
index 866c3a8986..484a6a03ed 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java
@@ -670,11 +670,20 @@ void removeControl (Control control) {
}
}
+void setBackgroundImage (int hBitmap) {
+ super.setBackgroundImage (hBitmap);
+ setBackgroundTransparent (hBitmap != 0);
+}
+
void setBackgroundPixel (int pixel) {
super.setBackgroundPixel (pixel);
+ setBackgroundTransparent (pixel != -1);
+}
+
+void setBackgroundTransparent (boolean transparent) {
/*
* Feature in Windows. When TBSTYLE_TRANSPARENT is set
- * in a tool bar that is drawing a background, image in
+ * in a tool bar that is drawing a background, images in
* the image list that include transparency information
* do not draw correctly. The fix is to clear and set
* TBSTYLE_TRANSPARENT depending on the background color.
@@ -686,7 +695,7 @@ void setBackgroundPixel (int pixel) {
if ((style & SWT.FLAT) != 0) {
if (OS.COMCTL32_MAJOR < 6 || !OS.IsAppThemed ()) {
int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);
- if (pixel == -1) {
+ if (!transparent && findBackgroundControl () == null) {
bits &= ~OS.TBSTYLE_TRANSPARENT;
} else {
bits |= OS.TBSTYLE_TRANSPARENT;