|
|
6ba05ab |
--- org/gudy/azureus2/ui/swt/ImageRepository.java.orig 2006-04-24 06:11:48.000000000 -0700
|
|
|
6ba05ab |
+++ org/gudy/azureus2/ui/swt/ImageRepository.java 2006-05-12 09:54:14.000000000 -0700
|
|
|
b84895e |
@@ -32,6 +32,8 @@
|
|
|
392c459 |
import java.io.ByteArrayOutputStream;
|
|
|
392c459 |
import java.io.File;
|
|
|
392c459 |
import java.io.InputStream;
|
|
|
392c459 |
+import java.io.FileInputStream;
|
|
|
392c459 |
+import java.io.FileNotFoundException;
|
|
|
6ba05ab |
import java.lang.reflect.Method;
|
|
|
392c459 |
import java.util.*;
|
|
|
392c459 |
|
|
|
6ba05ab |
@@ -61,6 +63,25 @@
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/splash/azureus.jpg", "azureus_splash");
|
|
|
392c459 |
}
|
|
|
392c459 |
|
|
|
392c459 |
+ private static org.gnu.gtk.IconTheme iconTheme;
|
|
|
392c459 |
+
|
|
|
392c459 |
+ public static String getThemedIcon (String name, String def)
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ try
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ if (iconTheme == null)
|
|
|
392c459 |
+ iconTheme = org.gnu.gtk.IconTheme.getDefault();
|
|
|
392c459 |
+
|
|
|
b84895e |
+ org.gnu.gtk.IconInfo icon = iconTheme.lookupIcon (name, 24,
|
|
|
b84895e |
+ org.gnu.gtk.IconLookupFlags.NO_SVG);
|
|
|
b84895e |
+ return icon != null ? icon.getFilename() : def;
|
|
|
392c459 |
+ }
|
|
|
392c459 |
+ catch (Exception ex)
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ return def;
|
|
|
392c459 |
+ }
|
|
|
392c459 |
+ }
|
|
|
392c459 |
+
|
|
|
392c459 |
public static void loadImages(Display display) {
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/icons/a32.png", "azureus32");
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/icons/a64.png", "azureus64");
|
|
|
6ba05ab |
@@ -105,20 +126,44 @@
|
|
|
392c459 |
//ToolBar Icons
|
|
|
392c459 |
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/open.gif", "cb_open");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/open_no_default.gif", "cb_open_no_default");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("fileopen", "org/gudy/azureus2/ui/icons/toolbar/open_no_default.gif"),
|
|
|
392c459 |
+ "cb_open_no_default");
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/open_folder.gif", "cb_open_folder");
|
|
|
392c459 |
loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/open_url.gif", "cb_open_url");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/new.gif", "cb_new");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/up.gif", "cb_up");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/down.gif", "cb_down");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/top.gif", "cb_top");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/bottom.gif", "cb_bottom");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/run.gif", "cb_run");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/start.gif", "cb_start");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/stop.gif", "cb_stop");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/remove.gif", "cb_remove");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/host.gif", "cb_host");
|
|
|
392c459 |
- loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/publish.gif", "cb_publish");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("filenew", "org/gudy/azureus2/ui/icons/toolbar/new.gif"),
|
|
|
392c459 |
+ "cb_new");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-go-up", "org/gudy/azureus2/ui/icons/toolbar/up.gif"),
|
|
|
392c459 |
+ "cb_up");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-go-down", "org/gudy/azureus2/ui/icons/toolbar/down.gif"),
|
|
|
392c459 |
+ "cb_down");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-goto-top", "org/gudy/azureus2/ui/icons/toolbar/top.gif"),
|
|
|
392c459 |
+ "cb_top");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-goto-bottom", "org/gudy/azureus2/ui/icons/toolbar/bottom.gif"),
|
|
|
392c459 |
+ "cb_bottom");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("exec", "org/gudy/azureus2/ui/icons/toolbar/run.gif"),
|
|
|
392c459 |
+ "cb_run");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-go-forward", "org/gudy/azureus2/ui/icons/toolbar/start.gif"),
|
|
|
392c459 |
+ "cb_start");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gtk-stop", "org/gudy/azureus2/ui/icons/toolbar/stop.gif"),
|
|
|
392c459 |
+ "cb_stop");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("edit_remove", "org/gudy/azureus2/ui/icons/toolbar/remove.gif"),
|
|
|
392c459 |
+ "cb_remove");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("gohome", "org/gudy/azureus2/ui/icons/toolbar/host.gif"),
|
|
|
392c459 |
+ "cb_host");
|
|
|
392c459 |
+ loadImage(display,
|
|
|
392c459 |
+ getThemedIcon ("icon-html", "org/gudy/azureus2/ui/icons/toolbar/publish.gif"),
|
|
|
392c459 |
+ "cb_publish");
|
|
|
6ba05ab |
loadImage(display, "org/gudy/azureus2/ui/icons/toolbar/sendto.png", "cb_send");
|
|
|
392c459 |
|
|
|
392c459 |
//Status icons
|
|
|
6ba05ab |
@@ -167,6 +212,16 @@
|
|
|
392c459 |
Image im = getImage(name,false);
|
|
|
392c459 |
if(null == im) {
|
|
|
392c459 |
InputStream is = loader.getResourceAsStream(res);
|
|
|
392c459 |
+ if (is == null)
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ try
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ is = new FileInputStream (res);
|
|
|
392c459 |
+ }
|
|
|
392c459 |
+ catch (FileNotFoundException fnf)
|
|
|
392c459 |
+ {
|
|
|
392c459 |
+ }
|
|
|
392c459 |
+ }
|
|
|
392c459 |
if(null != is) {
|
|
|
392c459 |
try {
|
|
|
392c459 |
if(alpha == 255) {
|
|
|
6ba05ab |
@@ -483,4 +538,4 @@
|
|
|
b84895e |
|
|
|
b84895e |
return key;
|
|
|
b84895e |
}
|
|
|
b84895e |
-}
|
|
|
6ba05ab |
\ No newline at end of file
|
|
|
b84895e |
+}
|