Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Michel-Lemieux2002-05-06 19:51:34 +0000
committerJean Michel-Lemieux2002-05-06 19:51:34 +0000
commit77ac53500fbc8a37038e9af03607fc92abddadf9 (patch)
treead9969be56fe12931b9f036584f5af5f03c4f06c
parent45835665c084b5e67cacd394abe3652ce1a7d12c (diff)
downloadeclipse.platform.team-77ac53500fbc8a37038e9af03607fc92abddadf9.tar.gz
eclipse.platform.team-77ac53500fbc8a37038e9af03607fc92abddadf9.tar.xz
eclipse.platform.team-77ac53500fbc8a37038e9af03607fc92abddadf9.zip
Bug 15306: CVSDecortator caching doesn't handle icons of different sizes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java12
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/OverlayIconCache.java2
2 files changed, 8 insertions, 6 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
index 278d4bd24..eac66fc09 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorator.java
@@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.LabelProviderChangedEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ccvs.core.CVSException;
@@ -80,16 +81,17 @@ public class CVSDecorator extends LabelProvider implements ILabelDecorator, IRes
// Keep track of deconfigured projects
private Set deconfiguredProjects = new HashSet();
- private static class DecoratorOverlayIcon extends OverlayIcon {
- private static final int HEIGHT = 16;
- private static final int WIDTH = 16;
+ private static class DecoratorOverlayIcon extends OverlayIcon {
public DecoratorOverlayIcon(Image base, ImageDescriptor[] overlays) {
- super(base, overlays, new Point(WIDTH, HEIGHT));
+ super(base, overlays, new Point(base.getBounds().width, base.getBounds().height));
}
+ // all cvs overlays are shown on the rightmost portion
+ // of the base image
protected void drawOverlays(ImageDescriptor[] overlays) {
for (int i = overlays.length - 1; i >= 0; --i) {
ImageData imageData = overlays[i].getImageData();
- drawImage(imageData, 0, 0);
+ Point p = getSize();
+ drawImage(imageData, p.x-imageData.width, 0);
}
}
}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/OverlayIconCache.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/OverlayIconCache.java
index 906b0fa3e..6b465cdcb 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/OverlayIconCache.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/OverlayIconCache.java
@@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * IBM - Initial implementation
******************************************************************************/
package org.eclipse.team.internal.ccvs.ui;

Back to the top