Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 68737 Details for
Bug 189083
[render] colored labels shifted to the right and margin smaller between icon and text
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
189083.patch (text/plain), 2.40 KB, created by
Martin Aeschlimann
on 2007-05-25 04:35:30 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Martin Aeschlimann
Created:
2007-05-25 04:35:30 EDT
Size:
2.40 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/viewsupport/OwnerDrawSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/viewsupport/OwnerDrawSupport.java,v >retrieving revision 1.13 >diff -u -r1.13 OwnerDrawSupport.java >--- ui/org/eclipse/jdt/internal/ui/viewsupport/OwnerDrawSupport.java 24 May 2007 11:04:05 -0000 1.13 >+++ ui/org/eclipse/jdt/internal/ui/viewsupport/OwnerDrawSupport.java 25 May 2007 08:26:48 -0000 >@@ -80,15 +80,15 @@ > private void performPaint(Event event) { > Item item= (Item) event.item; > GC gc= event.gc; >- Image image= item.getImage(); >- if (image != null) { >- int yOffset= Math.max(0, (event.height - image.getBounds().height) / 2); >- gc.drawImage(image, event.x, event.y + yOffset); >- } >+ > ColoredString coloredLabel= getColoredLabel(item); > boolean isSelected= (event.detail & SWT.SELECTED) != 0 && fControl.isFocusControl(); > if (item instanceof TreeItem) { > TreeItem treeItem= (TreeItem) item; >+ Image image = treeItem.getImage(event.index); >+ if (image != null) { >+ processImage(image, gc, treeItem.getImageBounds(event.index)); >+ } > Rectangle textBounds= treeItem.getTextBounds(event.index); > Font font= treeItem.getFont(event.index); > processColoredLabel(coloredLabel, gc, textBounds, isSelected, font); >@@ -99,6 +99,10 @@ > } > } else if (item instanceof TableItem) { > TableItem tableItem= (TableItem) item; >+ Image image = tableItem.getImage(event.index); >+ if (image != null) { >+ processImage(image, gc, tableItem.getImageBounds(event.index)); >+ } > Rectangle textBounds= tableItem.getTextBounds(event.index); > Font font= tableItem.getFont(event.index); > processColoredLabel(coloredLabel, gc, textBounds, isSelected, font); >@@ -110,6 +114,13 @@ > } > } > >+ private void processImage(Image image, GC gc, Rectangle imageBounds) { >+ Rectangle bounds= image.getBounds(); >+ int x= imageBounds.x + Math.max(0, (imageBounds.width - bounds.width) / 2); >+ int y= imageBounds.y + Math.max(0, (imageBounds.height - bounds.height) / 2); >+ gc.drawImage(image, x, y); >+ } >+ > private void processColoredLabel(ColoredString richLabel, GC gc, Rectangle textBounds, boolean isSelected, Font font) { > String text= richLabel.getString(); > fTextLayout.setText(text);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189083
: 68737