Bug 208866 - Content of first cell in table is misaligned.
Summary: Content of first cell in table is misaligned.
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Steve Northover CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-06 05:11 EST by Wassim Melhem CLA
Modified: 2019-09-06 16:18 EDT (History)
4 users (show)

See Also:


Attachments
Striped table (33.68 KB, image/x-png)
2007-11-06 05:12 EST, Wassim Melhem CLA
no flags Details
snippet to demonstrate the problem (2.33 KB, application/octet-stream)
2007-11-06 12:01 EST, Wassim Melhem CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wassim Melhem CLA 2007-11-06 05:11:17 EST
Build ID: 3.3.1

Steps To Reproduce:
When displaying results in a table column, it is very clear that when the cell has a colored background that the content of the first cell is a few pixels off to the right.

We see a sliver of white to the left.  Screenshot to follow.

More information:
Comment 1 Wassim Melhem CLA 2007-11-06 05:12:45 EST
Created attachment 82179 [details]
Striped table
Comment 2 Steve Northover CLA 2007-11-06 08:43:45 EST
I don't think that there's much I can do about this.  Windows leaves this margin.
Comment 3 Steve Northover CLA 2007-11-06 08:46:13 EST
I might be able to do something but it seems low priortity.  Closing as WONTFIX...
Comment 4 Steve Northover CLA 2007-11-06 08:46:51 EST
... you can reopen with test code, present you case a bit stronger etc.
Comment 5 Wassim Melhem CLA 2007-11-06 09:12:39 EST
but how are we supposed to build professional grade native-looking Eclipse-based database development IDEs with margins like that when others don't have them? :)

Here is what some Joe Schmoe was able to accomplish out of his basement:
http://www.sql-server-performance.com/images/nb_execution_plan_statistics1.jpg
Comment 6 Steve Northover CLA 2007-11-06 11:13:40 EST
Eh?  Just attach the test code, reopen the bug and I'll see what I can do (if you care).  You can probably get what you want with custom draw but let's not go there first.
Comment 7 Wassim Melhem CLA 2007-11-06 11:32:54 EST
Thanks Steve.  Will attach a snippet in the next day or so. 

Any insight/workaround/fix will be greatly appreciated.
Comment 8 Wassim Melhem CLA 2007-11-06 12:01:17 EST
Created attachment 82221 [details]
snippet to demonstrate the problem
Comment 9 Wassim Melhem CLA 2007-11-06 12:02:38 EST
Reopening for consideration.  

Steve, please let me know if the snippet is sufficient.
Comment 10 David Császár CLA 2009-11-19 17:56:52 EST
Here is my workaround:
Start with a zero width dummy column.
Comment 11 Eleanor Joslin CLA 2009-11-24 06:01:58 EST
(In reply to comment #10)
> Here is my workaround:
> Start with a zero width dummy column.

This didn't work for me on XP, Vista or Windows 7.
Comment 12 David Császár CLA 2009-11-24 14:24:30 EST
It works for me on XP, both default and classic theme!
Just took the attachment 82221 [details] snippet and changed setWidth(30) to setWidth(i == 0 ? 0 : 30) to make the white stripe disappear.
Comment 13 Kevin Hand CLA 2009-12-30 17:08:19 EST
Using a dummy column is a slipper slope. You then have to deal with it when setMoveable is True.

Instead of letting the table draw its own images using getColumnImage in your label provider, override PaintItem on your table, and paint the image then. If you haven't already, see the EraseItem workaround (https://bugs.eclipse.org/bugs/show_bug.cgi?id=50163) to paint the background color you want first. PaintItem is called after each EraseItem, so you can store objects looked up Erase for used in Paint in the event.item if you want as well to save computations.
Comment 14 Kevin Hand CLA 2009-12-30 17:08:31 EST
Using a dummy column is a slippery slope. You then have to deal with it when setMoveable is True.

Instead of letting the table draw its own images using getColumnImage in your label provider, override PaintItem on your table, and paint the image then. If you haven't already, see the EraseItem workaround (https://bugs.eclipse.org/bugs/show_bug.cgi?id=50163) to paint the background color you want first. PaintItem is called after each EraseItem, so you can store objects looked up Erase for used in Paint in the event.item if you want as well to save computations.
Comment 15 Eclipse Webmaster CLA 2019-09-06 16:18:20 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.

If you have further information on the current state of the bug, please add it. 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.