]> www.fi.muni.cz Git - evince.git/commitdiff
Use icon theme associated with the window screen rather than default.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 19 Jan 2007 18:14:36 +0000 (18:14 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Fri, 19 Jan 2007 18:14:36 +0000 (18:14 +0000)
2007-01-19  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-stock-icons.c: (ev_stock_icons_init):
* shell/ev-application.c: (ev_application_open_uri_at_dest):
Use icon theme associated with the window screen rather than default.

svn path=/trunk/; revision=2238

ChangeLog
shell/ev-application.c
shell/ev-stock-icons.c

index c1cebee7a6b39ed235ce1b284f738d8317ba55e2..e272e8caf9885958d60758a5dba313dd77c68374 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-19  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-stock-icons.c: (ev_stock_icons_init):
+       * shell/ev-application.c: (ev_application_open_uri_at_dest):
+
+       Use icon theme associated with the window screen rather than default. 
+
 2007-01-19  Luca Ferretti  <elle.uca@libero.it>
 
        * configure.ac:
index 98bbd3e3e8dc44ec02ffcd6275eee476ba58defd..53d284f1fad805d28f234b1fe91de26edce896e7 100644 (file)
@@ -345,10 +345,36 @@ ev_application_open_uri_at_dest (EvApplication  *application,
                                 gboolean        unlink_temp_file,
                                 guint           timestamp)
 {
-       EvWindow *new_window;
+       EvWindow     *new_window;
+       GtkIconTheme *icon_theme;
 
        g_return_if_fail (uri != NULL);
 
+       icon_theme = gtk_icon_theme_get_for_screen (screen);
+       if (icon_theme) {
+               gchar **path = NULL;
+               gint    n_paths;
+               gint    i;
+               gchar  *ev_icons_path;
+
+               /* GtkIconTheme will then look in Evince custom hicolor dir
+                * for icons as well as the standard search paths
+                */
+               ev_icons_path = g_build_filename (DATADIR, "icons", NULL);
+               gtk_icon_theme_get_search_path (icon_theme, &path, &n_paths);
+               for (i = n_paths - 1; i >= 0; i--) {
+                       if (g_ascii_strcasecmp (ev_icons_path, path[i]) == 0)
+                               break;
+               }
+
+               if (i < 0)
+                       gtk_icon_theme_append_search_path (icon_theme,
+                                                          ev_icons_path);
+
+               g_free (ev_icons_path);
+               g_strfreev (path);
+       }       
+
        new_window = ev_application_get_uri_window (application, uri);
        
        if (new_window == NULL) {
index 3b304895f5371804d93c6481f3f8339103eabf30..f2d059b9cd4c8e8300c6774b912df39352f71f21 100644 (file)
@@ -21,8 +21,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#include <config.h>
-
 #include "ev-stock-icons.h"
 
 #include <gtk/gtkiconfactory.h>
@@ -45,7 +43,6 @@ static const EvStockIcon stock_icons [] = {
        { EV_STOCK_ROTATE_RIGHT,     "object-rotate-right"},
 };
 
-
 void
 ev_stock_icons_init (void)
 {
@@ -73,12 +70,4 @@ ev_stock_icons_init (void)
        gtk_icon_source_free (source);
 
        g_object_unref (G_OBJECT (factory));
-
-        /* GtkIconTheme will then look in Evince custom hicolor dir
-         * for icons as well as the standard search paths
-         */
-        /* FIXME: multi-head! */
-        gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
-                                           DATADIR G_DIR_SEPARATOR_S "icons");
-
 }