diff options
author | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2011-11-16 10:24:45 -0500 |
---|---|---|
committer | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2011-11-16 10:24:45 -0500 |
commit | 3402626c77b2f77f119c9f1241008280ef56a646 (patch) | |
tree | 9f91e95331b9b40b806b7949d00d9c015dde517a /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets | |
parent | 846615db62063b0eedd351935c50563f4bfae4b1 (diff) | |
download | eclipse.platform.swt-3402626c77b2f77f119c9f1241008280ef56a646.tar.gz eclipse.platform.swt-3402626c77b2f77f119c9f1241008280ef56a646.tar.xz eclipse.platform.swt-3402626c77b2f77f119c9f1241008280ef56a646.zip |
Bug 363801 - CCombo has a bad initial visibleItemCount
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java index 49cae17511..10c005e006 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java @@ -162,6 +162,14 @@ public CCombo (Composite parent, int style) { for (int i=0; i<arrowEvents.length; i++) arrow.addListener (arrowEvents [i], listener); createPopup(null, -1); + if ((style & SWT.SIMPLE) == 0) { + int itemHeight = list.getItemHeight (); + if (itemHeight != 0) { + int maxHeight = getMonitor().getClientArea().height / 3; + visibleItemCount = Math.max(visibleItemCount, maxHeight / itemHeight); + } + } + initAccessible(); } static int checkStyle (int style) { |