summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2004-02-12 19:30:37 +0000
committerFelipe Heidrich <fheidric>2004-02-12 19:30:37 +0000
commit6dfada09fce7534836dfda13677bbc5ed1930c84 (patch)
tree803599ad28cecd4f21fdf6de55a4d7f50e47ec86
parent155c56b5b9a7f28e7dfb59f29cc7f30ca5b76245 (diff)
downloadeclipse.platform.swt-6dfada09fce7534836dfda13677bbc5ed1930c84.tar.gz
eclipse.platform.swt-6dfada09fce7534836dfda13677bbc5ed1930c84.tar.xz
eclipse.platform.swt-6dfada09fce7534836dfda13677bbc5ed1930c84.zip
38643
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java23
1 files changed, 23 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 1a335b6862..f3e91604dd 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
@@ -615,6 +615,29 @@ 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);
+ }
+ layoutItems ();
+}
+
void setHotImageList (ImageList imageList) {
if (hotImageList == imageList) return;
int hImageList = 0;