aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-12 11:36:29 (EDT)
committerChris Aniszczyk2011-04-12 14:05:15 (EDT)
commit5f60a4f9d8b13fc220b39d76f4683facdef0815f (patch)
treead211cb961934a6f96de32e0ba372f5cd1a1f2c2
parent3100a8650818c3788d5d17b0ab3748f4516597a6 (diff)
downloadegit-github-5f60a4f9d8b13fc220b39d76f4683facdef0815f.zip
egit-github-5f60a4f9d8b13fc220b39d76f4683facdef0815f.tar.gz
egit-github-5f60a4f9d8b13fc220b39d76f4683facdef0815f.tar.bz2
Add icon for issue labels for query dialog and task editorrefs/changes/69/3069/2
Change-Id: I82e583d3551e0067d881a89defa8ee0443e7fcf9 Signed-off-by: Kevin Sawicki <kevin@github.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.mylyn.github.ui/icons/obj16/issue_label.pngbin0 -> 586 bytes
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubImages.java5
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubIssueLabelPart.java10
3 files changed, 10 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.github.ui/icons/obj16/issue_label.png b/org.eclipse.mylyn.github.ui/icons/obj16/issue_label.png
new file mode 100644
index 0000000..454a59f
--- /dev/null
+++ b/org.eclipse.mylyn.github.ui/icons/obj16/issue_label.png
Binary files differ
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubImages.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubImages.java
index ef059ad..3a07328 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubImages.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubImages.java
@@ -29,9 +29,13 @@ public class GitHubImages {
private static ImageRegistry manager;
public static final String GITHUB_LOGO_OBJ = NAME_PREFIX + "OBJ_GITHUB_LOGO"; //$NON-NLS-1$
+ public static final String GITHUB_ISSUE_LABEL_OBJ = NAME_PREFIX + "OBJ_GITHUB_ISSUE_LABEL"; //$NON-NLS-1$
+
public static final ImageDescriptor DESC_GITHUB_LOGO = create(PATH_OBJ, "github.png"); //$NON-NLS-1$
+ public static final ImageDescriptor DESC_GITHUB_ISSUE_LABEL = create(PATH_OBJ, "issue_label.png"); //$NON-NLS-1$
+
private static ImageDescriptor create(String prefix, String name) {
return ImageDescriptor.createFromURL(makeImageURL(prefix, name));
}
@@ -45,6 +49,7 @@ public class GitHubImages {
private static final void initialize() {
manager = new ImageRegistry();
manage(GITHUB_LOGO_OBJ, DESC_GITHUB_LOGO);
+ manage(GITHUB_ISSUE_LABEL_OBJ, DESC_GITHUB_ISSUE_LABEL);
}
private static URL makeImageURL(String prefix, String name) {
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubIssueLabelPart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubIssueLabelPart.java
index 81a6f23..f91b663 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubIssueLabelPart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubIssueLabelPart.java
@@ -16,16 +16,14 @@ import org.eclipse.mylyn.github.internal.GitHubTaskAttributes;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPart;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Editor part for viewing a issue's labels.
- *
- * @author Kevin Sawicki (kevin@github.com)
*/
public class GitHubIssueLabelPart extends AbstractTaskEditorPart {
@@ -41,8 +39,10 @@ public class GitHubIssueLabelPart extends AbstractTaskEditorPart {
TaskAttribute labels = getTaskData().getRoot().getAttribute(
GitHubTaskAttributes.LABELS.getId());
if (labels != null) {
- Label labelControl = toolkit.createLabel(displayArea, labels
- .getMetaData().getLabel());
+ CLabel labelControl = new CLabel(displayArea, SWT.NONE);
+ labelControl.setText(labels.getMetaData().getLabel());;
+ labelControl.setImage(GitHubImages.get(GitHubImages.GITHUB_ISSUE_LABEL_OBJ));
+ toolkit.adapt(labelControl, false, false);
labelControl.setForeground(toolkit.getColors().getColor(
IFormColors.TITLE));