Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 188859 - [render] colored labels shifted to the right and margin smaller between icon and text
Summary: [render] colored labels shifted to the right and margin smaller between icon ...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: 3.3 RC2   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 189083
  Show dependency tree
 
Reported: 2007-05-24 05:56 EDT by Dani Megert CLA
Modified: 2007-05-25 03:21 EDT (History)
2 users (show)

See Also:


Attachments
screenshot comparison (6.24 KB, image/png)
2007-05-24 06:19 EDT, Martin Aeschlimann CLA
no flags Details
Patch for OwnerDrawSupport class (2.32 KB, patch)
2007-05-24 18:48 EDT, Silenio Quarti CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2007-05-24 05:56:20 EDT
3.3 RC1.

When enabling colored labels the icon and the text get shifted to the right and the margin between icon and text becomes smaller.

The shifting is less bad than the small (almost inexistent) margin.

This does not happen in WindowsXP. Should also check Mac.
Comment 1 Martin Aeschlimann CLA 2007-05-24 06:17:19 EDT
Seems to be something special under linux.
- open package explorer
- open Java > Appearance preference page, move the page so you can see the package explorer in the back
- check 'colored labels', press 'Apply'
 > image and the text in the package explorer move the horizontally to the right
- uncheck 'colored labels', press 'Apply'
 
We draw the image at event.x, the text at item.getTextBounds().x.
Please advise if this is not the correct thing to do.
Comment 2 Martin Aeschlimann CLA 2007-05-24 06:19:10 EDT
Created attachment 68536 [details]
screenshot comparison
Comment 3 Steve Northover CLA 2007-05-24 07:59:19 EDT
Under consideration for Eclipse 3.3 RC2.
Comment 4 Silenio Quarti CLA 2007-05-24 18:48:50 EDT
Created attachment 68690 [details]
Patch for OwnerDrawSupport class
Comment 5 Silenio Quarti CLA 2007-05-24 18:54:25 EDT
The code in OwnerDrawSupport should be using getImageBounds() and getTextBounds(). There is still a bug in getTextBounds() on GTK, so you will not draw exactly like the operating system. We will not fix this bug for eclipse 3.3.

There was a clipping bug in SWT.PaintItem that is fixed. Please apply the patch. It should be good enough for 3.3.

Fixed > 20070524
Comment 6 Steve Northover CLA 2007-05-24 18:54:43 EDT
+1
Comment 7 Felipe Heidrich CLA 2007-05-24 18:56:11 EDT
+1
Comment 8 Dani Megert CLA 2007-05-25 03:21:16 EDT
So - to summarize:
- you found a bug in SWT.PaintItem and fixed, that's why this bug got closed
- you found a bug in JDT UI --> filed bug 189083 for that.
- you found another bug in SWT getTextBounds() --> filed bug 189084 for that as I could not find one in bugzilla