Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2014-07-15 05:48:25 +0000
committerNiraj Modi2014-07-15 05:48:25 +0000
commiteb55220dd67f266f9c2b3524808a7b606843e2ba (patch)
tree5cfbbfc667d2c285131fd4c3c1d826ab7a513388 /bundles/org.eclipse.swt/Eclipse SWT
parentfaa3866df482c0e42ac5b308a5551882f833a3aa (diff)
downloadeclipse.platform.swt-eb55220dd67f266f9c2b3524808a7b606843e2ba.tar.gz
eclipse.platform.swt-eb55220dd67f266f9c2b3524808a7b606843e2ba.tar.xz
eclipse.platform.swt-eb55220dd67f266f9c2b3524808a7b606843e2ba.zip
Bug 437206 - Multiple ToolItems with SWT.DROP_DOWN truncated with
SWT.VERTICAL Change-Id: Ia1f5364c686715bc4dd86a688342bb4c22b0c17b Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ToolBar.java17
1 files changed, 13 insertions, 4 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 76d89397ec..1abd14583c 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -717,15 +717,24 @@ void layoutItems () {
info.dwMask = OS.TBIF_SIZE;
long /*int*/ size = OS.SendMessage (handle, OS.TB_GETBUTTONSIZE, 0, 0);
info.cx = (short) OS.LOWORD (size);
- int index = 0;
+ int index = 0, extraPadding = 0;
while (index < items.length) {
ToolItem item = items [index];
- if (item != null && (item.style & SWT.DROP_DOWN) != 0) break;
+ if (item != null && (item.style & SWT.DROP_DOWN) != 0) {
+ /*
+ * Specifying 1 pixel extra padding to avoid truncation
+ * of widest item in the tool-bar when a tool-bar has
+ * SWT.VERTICAL style and any of the items in the
+ * tool-bar has SWT.DROP_DOWN style, Refer bug#437206
+ */
+ extraPadding = 1;
+ break;
+ }
index++;
}
if (index < items.length) {
long /*int*/ padding = OS.SendMessage (handle, OS.TB_GETPADDING, 0, 0);
- info.cx += OS.LOWORD (padding) * 2;
+ info.cx += OS.LOWORD (padding + extraPadding) * 2;
}
for (int i=0; i<items.length; i++) {
ToolItem item = items [i];

Back to the top