| Summary: | Combo drop down is too narrow | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Peter Severin <peter_p_s> | ||||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cocoakevin | ||||||
| Version: | 3.5 | Keywords: | triaged | ||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Mac OS X | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
Created attachment 136494 [details]
Combo drop down. Cocoa.
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 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. It could be SWT that's computing the size incorrectly. Please attach a snippet that demos the problem. 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. 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. 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. 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.
Bug triaged, visit https://wiki.eclipse.org/SWT/Devel/Triage for more information. 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. |
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).