Project: SWT
Bug 22036 MOTIF: Appearance issue with Combo
Reported: 2002-07-30 10:17:13 | Status: resolved fixed

In this test when the font is set to a particular font ("Serif for this test") by selecting the button on the shell, the down arrow which brings up the drop-down list is not visible because the font is too big. This down arrow is visible when the shell is resized. Once the shell is resized to a bigger size and the button is selected again to set the font to the system font, the down arrow is centered rather than being aligned to the right. But when the button is selected to set the font to "Serif" the down arrow appears aligned to the right. The test: -----------test case starts here---------------------------------- import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.*; public class TestSWTChoice { public static void main(String[] args) { final Display disp = Display.getDefault(); Shell shell = new Shell(disp); shell.setLayout(new FillLayout(SWT.VERTICAL)); final Combo combo = new Combo( shell, SWT.CLIP_CHILDREN | SWT.CLIP_SIBLINGS | SWT.READ_ONLY | SWT.DROP_DOWN); combo.add("first"); combo.add("second"); combo.add("third"); combo.add("fourth"); combo.select(0); final Font font = disp.getSystemFont(); final Font bigFont = new Font(disp, "Serif", 12, SWT.ITALIC | SWT.BOLD); combo.setFont(font); final Button button = new Button(shell, SWT.BORDER); button.setText("Default"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (combo.getFont().equals(font)) { button.setText("Serif"); combo.setFont(bigFont); } else { button.setText("Default"); combo.setFont(font); } } }); shell.setText("Choice Test"); shell.setSize(200, 200); shell.setLocation(0, 0); shell.open(); while (!shell.isDisposed()) { if (!disp.readAndDispatch()) { disp.sleep(); } } bigFont.dispose(); } } --------------test case ends here ------------------------------------

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Combo.java