Skip to content

Commit efb36c4

Browse files
HeikoKlareruspl-afed
authored andcommitted
Remove explicit hover and disabled icons from terminal bundles
The recently added terminal bundles contain explicit icons for the hover and disabled state of UI elements. The hover icons are equal to the ordinary enabled icons and the disabled icons can be generated by SWT on-the-fly. This change removes the just added hover and disabled icons. The hover icons are removed from the image registry and the registry's disabled icons are generated on-the-fly instead.
1 parent 7f4b9bc commit efb36c4

File tree

20 files changed

+47
-74
lines changed

20 files changed

+47
-74
lines changed
Binary file not shown.
Binary file not shown.

terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/control/actions/TerminalActionClearAll.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
package org.eclipse.terminal.control.actions;
2222

2323
import org.eclipse.terminal.control.ITerminalViewControl;
24+
import org.eclipse.terminal.internal.control.impl.ImageConsts;
2425

2526
public class TerminalActionClearAll extends AbstractTerminalAction {
2627
public TerminalActionClearAll() {
2728
super(TerminalActionClearAll.class.getName());
2829

29-
setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, ImageConsts.IMAGE_CLCL_CLEAR_ALL,
30-
ImageConsts.IMAGE_ELCL_CLEAR_ALL, ImageConsts.IMAGE_DLCL_CLEAR_ALL, false);
30+
setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, null, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
31+
ImageConsts.IMAGE_DLCL_CLEAR_ALL, false);
3132
}
3233

3334
public TerminalActionClearAll(ITerminalViewControl target) {
3435
super(target, TerminalActionClearAll.class.getName());
3536

36-
setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, ImageConsts.IMAGE_CLCL_CLEAR_ALL,
37-
ImageConsts.IMAGE_ELCL_CLEAR_ALL, ImageConsts.IMAGE_DLCL_CLEAR_ALL, false);
37+
setupAction(ActionMessages.CLEARALL, ActionMessages.CLEARALL, null, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
38+
ImageConsts.IMAGE_DLCL_CLEAR_ALL, false);
3839
}
3940

4041
@Override

terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/control/actions/ImageConsts.java renamed to terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/ImageConsts.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@
1717
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
1818
* Anna Dushistova (MontaVista) - [227537] moved actions from terminal.view to terminal plugin
1919
*******************************************************************************/
20-
package org.eclipse.terminal.control.actions;
20+
package org.eclipse.terminal.internal.control.impl;
2121

2222
public interface ImageConsts {
2323
public final static String IMAGE_DIR_ROOT = "icons/"; //$NON-NLS-1$
24-
public final static String IMAGE_DIR_LOCALTOOL = IMAGE_DIR_ROOT + "clcl16/"; // basic colors - size 16x16 //$NON-NLS-1$
25-
public final static String IMAGE_DIR_DLCL = IMAGE_DIR_ROOT + "dlcl16/"; // disabled - size 16x16 //$NON-NLS-1$
2624
public final static String IMAGE_DIR_ELCL = IMAGE_DIR_ROOT + "elcl16/"; // enabled - size 16x16 //$NON-NLS-1$
2725

28-
public static final String IMAGE_CLCL_CLEAR_ALL = "ImageClclClearAll"; //$NON-NLS-1$
29-
3026
public static final String IMAGE_DLCL_CLEAR_ALL = "ImageDlclClearAll"; //$NON-NLS-1$
3127

3228
public static final String IMAGE_ELCL_CLEAR_ALL = "ImageElclClearAll"; //$NON-NLS-1$

terminal/bundles/org.eclipse.terminal.control/src/org/eclipse/terminal/internal/control/impl/TerminalPlugin.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.eclipse.core.runtime.Platform;
2626
import org.eclipse.jface.resource.ImageDescriptor;
2727
import org.eclipse.jface.resource.ImageRegistry;
28-
import org.eclipse.terminal.control.actions.ImageConsts;
28+
import org.eclipse.swt.SWT;
2929
import org.eclipse.ui.plugin.AbstractUIPlugin;
3030
import org.osgi.framework.BundleContext;
3131

@@ -71,15 +71,12 @@ public static boolean isOptionEnabled(String strOption) {
7171
@Override
7272
protected void initializeImageRegistry(ImageRegistry imageRegistry) {
7373
try {
74-
// Local toolbars
75-
putImageInRegistry(imageRegistry, ImageConsts.IMAGE_CLCL_CLEAR_ALL,
76-
ImageConsts.IMAGE_DIR_LOCALTOOL + "clear_co.gif"); //$NON-NLS-1$
7774
// Enabled local toolbars
7875
putImageInRegistry(imageRegistry, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
7976
ImageConsts.IMAGE_DIR_ELCL + "clear_co.gif"); //$NON-NLS-1$
8077
// Disabled local toolbars
81-
putImageInRegistry(imageRegistry, ImageConsts.IMAGE_DLCL_CLEAR_ALL,
82-
ImageConsts.IMAGE_DIR_DLCL + "clear_co.gif"); //$NON-NLS-1$
78+
putDisabledImageInRegistry(imageRegistry, ImageConsts.IMAGE_ELCL_CLEAR_ALL,
79+
ImageConsts.IMAGE_DLCL_CLEAR_ALL);
8380
} catch (MalformedURLException malformedURLException) {
8481
malformedURLException.printStackTrace();
8582
}
@@ -91,4 +88,10 @@ protected void putImageInRegistry(ImageRegistry imageRegistry, String strKey, St
9188
ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url);
9289
imageRegistry.put(strKey, imageDescriptor);
9390
}
91+
92+
private void putDisabledImageInRegistry(ImageRegistry imageRegistry, String enabledKey, String disabledKey)
93+
throws MalformedURLException {
94+
ImageDescriptor enabledImageDescriptor = imageRegistry.getDescriptor(enabledKey);
95+
imageRegistry.put(disabledKey, ImageDescriptor.createWithFlags(enabledImageDescriptor, SWT.IMAGE_DISABLE));
96+
}
9497
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)