[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: LabelProvider and icon

Images in tables work like images in trees, which is that the largest image 
wins and sets the size for all other images. So any smaller image will be 
spaced out to the size of the largest image. As far as I know there's no way 
around it.

Here's bugs related to that:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=55380
https://bugs.eclipse.org/bugs/show_bug.cgi?id=4555

Here's a few others you may run across while putting images in tables:

Transparency issue when selecting a cell with an image that has transparet 
background:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=60815
https://bugs.eclipse.org/bugs/show_bug.cgi?id=17905

Image not accepting columns SWT.CENTER:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=26045

Image in table column headers causing indentation issues:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=89183

Theres a few others. Images in tables are not working that great 
unfortunately so you'll have to tweak it as best as you can.

You can feel the frustration of "Steve and Veronika vs. Windows (API)" from 
reading the bug comments.

Emil

"eyecanseeyou" <eyecanseeyou@xxxxxxx> wrote in message 
news:d57ht3$c0v$1@xxxxxxxxxxxxxxxxxxx
> Thank you for the details.
> And do you know why the width of the image in my 5th column is resized to 
> the same width of the image in my 4th column ?
>
>
> Emil Crumhorn wrote:
>> This is a known Windows "problem". It's actually working as intended (I 
>> think, although I don't see this behavior in most windows apps), but I 
>> agree it's nasty.
>>
>> The trick is to create column before all your other ones, but set it to 
>> width 0 and to not be resizable (nor moveable if you do that stuff), so 
>> basically it's invisible. Then just put all your data in the the other 
>> columns (at index 1+) and images will show up correctly without spacing 
>> out any other columns.
>>
>> I should mention however, that this trick does not work on Mac. So if you 
>> are doing stuff for both platforms, do a mac/windows check before you 
>> create that, and remember to offset your counts by 1 depending on the 
>> platform. I don't know how Linux does it.
>>
>> Emil