Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 277135

Summary: Combo drop down is too narrow
Product: [Eclipse Project] Platform Reporter: Peter Severin <peter_p_s>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: cocoakevin
Version: 3.5Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug
Attachments:
Description Flags
Combo drop down. Carbon.
none
Combo drop down. Cocoa. none

Description Peter Severin CLA 2009-05-20 10:05:51 EDT
Created attachment 136493 [details]
Combo drop down. Carbon.

I've just test Eclipse 3.5RC1/Cocoa. A have a place where I use a combo box for font size selection. Combo items are font sizes from 8 to 72. When I open the combo drop down it takes the size of the combo widget which is too small. I've attached 2 screenshots, one under carbon (Eclipse 3.4), the other under cocoa (Eclipse 3.5).
Comment 1 Peter Severin CLA 2009-05-20 10:06:37 EDT
Created attachment 136494 [details]
Combo drop down. Cocoa.
Comment 2 Kevin Barnes CLA 2009-05-20 13:50:12 EDT
Looks like a size is either being computed incorrectly, or set too small.
Preferred size in ControlExample does not have this problem.
Not for 3.5
Comment 3 Peter Severin CLA 2009-05-20 15:21:28 EDT
I am not sure what you mean. In my case the size of the combo is its default size. If it's of any help I'm using GridLayout.
Comment 4 Kevin Barnes CLA 2009-05-20 15:27:36 EDT
It could be SWT that's computing the size incorrectly.
Please attach a snippet that demos the problem.
Comment 5 Peter Severin CLA 2009-05-20 16:37:12 EDT
I've tried to make a standalone test case but couldn't reproduce the problem. However I've noticed a strange thing. All editable combos in Eclipse have a smaller height. Also the scrollbar in the drop down is smaller. How can it be? For a comparison check the combo in Eclipse->Preferences->General->Workspace->Text Encoding.
Comment 6 Peter Severin CLA 2009-06-09 18:28:29 EDT
Is there any chance for this bug to be corrected? I'm able to reproduce the problem using the SWT examples. If the size of the combo is set to 50x50 then the width of the drop down is the width of the control and all the items in the list are truncated. This is not the case in Carbon builds. I think the width of the drop down should always be given by the longest item in the list.
Comment 7 Grant Gayed CLA 2009-06-10 10:49:44 EDT
This can't be done for 3.5, the code is frozen, only doc changes can be made.  This will be investigated after 3.5.
Comment 8 Grant Gayed CLA 2009-06-23 16:35:12 EDT
I think this only happens if items are added after the combo's size has been set.  Example snippet:

public static void main(String[] args) {
    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setBounds(10,10,200,200);
    Combo combo = new Combo(shell, SWT.NONE);
    for (int i = 0; i < 9; i++) {
    	combo.add("one");
    	combo.add("one two");
    }
    combo.pack();
    combo.add("one two three");
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) display.sleep();
    }
    display.dispose();
}

The drop down list never wants to become wider than the width of the text field + drop down button, even if it's showing a vertical scrollbar.  It doesn't look like NSComboBox provides any access to its drop down list control, and I don't see another way to influence its size, so this may just be the expected platform behaviour.

Keeping report open for now in case I'm missing something, but it may ultimately be a WONTFIX.
Comment 9 Lakshmi P Shanmugam CLA 2017-07-04 07:42:02 EDT
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more
information.
Comment 10 Eclipse Genie CLA 2020-08-23 12:34:58 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.