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 076bc0272f..b06f16b045 100644 --- 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 @@ -255,6 +255,12 @@ Point computeSizeInPixels (Point hintInPoints, int zoom, boolean changed) { OS.SendMessage (handle, OS.TB_GETITEMRECT, count - 1, rect); width = Math.max (width, rect.right); height = Math.max (height, rect.bottom); + // Adjust height for embedded controls (Combo, Text, etc.) + for (ToolItem item : items) { + if (item != null && item.getControl() != null) { + height = Math.max(height, item.getControl().getBoundsInPixels().height); + } + } } OS.SetWindowPos (handle, 0, 0, 0, oldWidth, oldHeight, flags); if (redraw) OS.ValidateRect (handle, null); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java index 59fa20c511..75a9ee8b06 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolItem.java @@ -583,7 +583,7 @@ void resizeControl () { control.setSize (itemRect.width, itemRect.height); Rectangle rect = control.getBounds (); rect.x = itemRect.x + (itemRect.width - rect.width) / 2; - rect.y = itemRect.y + (itemRect.height - rect.height) / 2; + rect.y = itemRect.y + Math.max(0, itemRect.height - rect.height) / 2; control.setLocation (rect.x, rect.y); } }