Community
Participate
Working Groups
Build Identifier: 20100617-1415 When using a TableViewer with an editor, on click of a cell, the editor is shown 3 pixels to the right overshooting the cell border. In TableItem getImageBounds(), there is a rect.x += Table.IMAGE_GAP at line 512. It seems like that addition should be done only when image != null? This visual artifact is very noticeable in Adobe Flash Builder and any tips on working around this would be much appreciated. Reproducible: Always Steps to Reproduce: 1. Use a TableViewer, assign a ComboBoxCellEditor to it. 2. Every time a cell is clicked, notice that the editor moves 3 pixels to the right causing the arrow to overshoot the cell.
(In reply to comment #0) > In TableItem getImageBounds(), there is a rect.x += Table.IMAGE_GAP at line > 512. It seems like that addition should be done only when image != null? No, this is correct. Run Snippet283 on Carbon and Cocoa -- the left edge of the images and the text are all in line. I will try to make a test case -- if you have one handy please attach it. I don't doubt this is a bug, but something I can compare against Carbon (for example) would be helpful.
I see one possible culprit and one workaround. My guess right now is that the default width of the editor for the ComboBoxCellEditor is now too big, so it's pushing the combo off the edge of the cell. You can work around that by using a subclass of ComboBoxCellEditor that overrides getLayoutData() to return a smaller minimumWidth. Currently it returns a width that's 10 * average char width for the current font. The rects returned by getImageBounds, getBounds, and getBounds(int) are different than what Carbon returns, but they are all consistent.
Hi Scott, Thank you, your workaround worked for me. I will work on making a small test case for this and posting it here. Thanks, Anirudh
This might end up going to JFace, but for now this is not a bug on SWT's part.