Skip to content

Commit 1132493

Browse files
committed
Remove explicit disabled icons from org.eclipse.ui.cheatsheets
Use on-the-fly-generated disabled version of SVG-rasterized icons instead.
1 parent fd7ae5b commit 1132493

File tree

3 files changed

+4
-26
lines changed

3 files changed

+4
-26
lines changed

ua/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/CheatSheetPlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public class CheatSheetPlugin extends AbstractUIPlugin {
6565
public static final IPath ICONS_PATH = IPath.fromOSString("$nl$/icons/"); //$NON-NLS-1$
6666
public static final String T_OBJ = "obj16/"; //$NON-NLS-1$
6767
public static final String T_ELCL = "elcl16/"; //$NON-NLS-1$
68-
public static final String T_DLCL = "dlcl16/"; //$NON-NLS-1$
6968
public static final String T_VIEW = "view16/"; //$NON-NLS-1$
7069

7170
/**

ua/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/composite/explorer/TreeLabelProvider.java

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Image lookupImage(String kind, int state, boolean isBlocked) {
106106
*/
107107
private ImageSet createImages(String kind) {
108108
ImageSet images = new ImageSet();
109-
ImageDescriptor desc = getPredefinedImageDescriptor(kind, true);
109+
ImageDescriptor desc = getPredefinedImageDescriptor(kind);
110110
if (desc == null) {
111111
desc = TaskEditorManager.getInstance().getImageDescriptor(kind);
112112
}
@@ -134,7 +134,7 @@ private ImageSet createImages(String kind) {
134134
return images;
135135
}
136136

137-
private ImageDescriptor getPredefinedImageDescriptor(String kind, boolean isEnabled) {
137+
private ImageDescriptor getPredefinedImageDescriptor(String kind) {
138138
String filename;
139139
if (ICompositeCheatsheetTags.CHEATSHEET_TASK_KIND.equals(kind)) {
140140
filename = "cheatsheet_task.svg"; //$NON-NLS-1$
@@ -147,13 +147,7 @@ private ImageDescriptor getPredefinedImageDescriptor(String kind, boolean isEnab
147147
} else {
148148
return null;
149149
}
150-
String iconPath = "$nl$/icons/"; //$NON-NLS-1$
151-
if (isEnabled) {
152-
iconPath += CheatSheetPlugin.T_OBJ;
153-
} else {
154-
iconPath += CheatSheetPlugin.T_DLCL;
155-
}
156-
iconPath += filename;
150+
String iconPath = "$nl$/icons/" + CheatSheetPlugin.T_OBJ + filename; //$NON-NLS-1$
157151
return createImageDescriptor(iconPath);
158152
}
159153

@@ -165,18 +159,7 @@ private void createImageWithOverlay(int state, String imagePath, ImageSet images
165159
}
166160

167161
private void createDisabledImage(String kind, int state, ImageSet images, Image baseImage) {
168-
// The four images for task_set, task_sequence, task_choice and cheatsheet_task can be found
169-
// in icons/dlcl16.
170-
// TODO extend the extension point to allow disabled images to be specified.
171-
//if
172-
173-
ImageDescriptor desc = getPredefinedImageDescriptor(kind, false);
174-
Image disabledImage;
175-
if (desc != null) {
176-
disabledImage = desc.createImage();
177-
} else {
178-
disabledImage = createGrayedImage(baseImage);
179-
}
162+
Image disabledImage = createGrayedImage(baseImage);
180163
images.put(state, disabledImage);
181164
}
182165

ua/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/views/CheatSheetExpandRestoreAction.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,13 @@ public class CheatSheetExpandRestoreAction extends Action {
2828
private boolean collapsed = false;
2929

3030
private final ImageDescriptor collapseImage;
31-
private final ImageDescriptor disabledImage;
3231

3332
public CheatSheetExpandRestoreAction(String title, boolean initValue, CheatSheetViewer viewer) {
3433
super(title);
3534
this.viewer = viewer;
3635

3736
IPath path = CheatSheetPlugin.ICONS_PATH.append(CheatSheetPlugin.T_ELCL).append("collapse_expand_all.svg");//$NON-NLS-1$
3837
collapseImage = CheatSheetPlugin.createImageDescriptor(CheatSheetPlugin.getPlugin().getBundle(), path);
39-
path = CheatSheetPlugin.ICONS_PATH.append(CheatSheetPlugin.T_DLCL).append("collapse_expand_all.png");//$NON-NLS-1$
40-
disabledImage = CheatSheetPlugin.createImageDescriptor(CheatSheetPlugin.getPlugin().getBundle(), path);
41-
setDisabledImageDescriptor(disabledImage);
4238
setImageDescriptor(collapseImage);
4339
setCollapsed(initValue);
4440
}

0 commit comments

Comments
 (0)