Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich2004-02-17 11:41:47 -0500
committerFelipe Heidrich2004-02-17 11:41:47 -0500
commit7139104bec6d637910a8dacf3f84f0e05753e236 (patch)
tree85c6a49f1d8c49fc376463cf3fd486f9293b600d
parent578b397b120bc3bfc269118a7011f53d430e5127 (diff)
downloadeclipse.platform.swt-7139104bec6d637910a8dacf3f84f0e05753e236.tar.gz
eclipse.platform.swt-7139104bec6d637910a8dacf3f84f0e05753e236.tar.xz
eclipse.platform.swt-7139104bec6d637910a8dacf3f84f0e05753e236.zip
backport 38643
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java22
1 files changed, 22 insertions, 0 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 df23af8f82..5d10adf73d 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
@@ -614,6 +614,28 @@ void setDisabledImageList (ImageList imageList) {
OS.SendMessage (handle, OS.TB_SETDISABLEDIMAGELIST, 0, hImageList);
}
+public void setFont (Font font) {
+ checkWidget ();
+ super.setFont (font);
+ /*
+ * Bug in Windows. When WM_SETFONT is sent to a tool bar
+ * that contains only separators, causes the bitmap and button
+ * sizes to be set. The fix is to reset these sizes after the font
+ * has been changed when the tool bar contains only separators.
+ */
+ int index = 0;
+ int mask = SWT.PUSH | SWT.CHECK | SWT.RADIO | SWT.DROP_DOWN;
+ while (index < items.length) {
+ ToolItem item = items [index];
+ if (item != null && (item.style & mask) != 0) break;
+ index++;
+ }
+ if (index == items.length) {
+ OS.SendMessage (handle, OS.TB_SETBITMAPSIZE, 0, 0);
+ OS.SendMessage (handle, OS.TB_SETBUTTONSIZE, 0, 0);
+ }
+}
+
void setHotImageList (ImageList imageList) {
if (hotImageList == imageList) return;
int hImageList = 0;

Back to the top