[gnumeric] Icons: Part IV.



commit 667f7428e369f3cc7f42e71020ff2c1e966f8ce5
Author: Morten Welinder <terra gnome org>
Date:   Fri Dec 26 21:26:05 2014 -0500

    Icons: Part IV.

 configure.ac                                       |    1 +
 icons/32x32/actions/Makefile.am                    |    3 +
 .../32x32/actions/cursor-cross.xpm                 |    0
 src/Makefile.am                                    |    1 -
 src/application.c                                  |   64 --------------------
 src/dialogs/dialog-cell-format.c                   |   12 ++--
 src/gnm.gresource.xml                              |   14 ++++
 src/item-grid.c                                    |    2 +-
 8 files changed, 24 insertions(+), 73 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 900339b..13291b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1097,6 +1097,7 @@ icons/24x24/Makefile
 icons/24x24/actions/Makefile
 icons/24x24/apps/Makefile
 icons/32x32/Makefile
+icons/32x32/actions/Makefile
 icons/32x32/apps/Makefile
 icons/48x48/Makefile
 icons/48x48/actions/Makefile
diff --git a/icons/32x32/actions/Makefile.am b/icons/32x32/actions/Makefile.am
new file mode 100644
index 0000000..1caa90f
--- /dev/null
+++ b/icons/32x32/actions/Makefile.am
@@ -0,0 +1,3 @@
+internalicons =
+
+EXTRA_DIST = $(internalicons)
diff --git a/src/pixmaps/cursor_cross.xpm b/icons/32x32/actions/cursor-cross.xpm
similarity index 100%
rename from src/pixmaps/cursor_cross.xpm
rename to icons/32x32/actions/cursor-cross.xpm
diff --git a/src/Makefile.am b/src/Makefile.am
index 6e8f1dc..1a93a1b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -437,7 +437,6 @@ gnumeric_app_libs =                         \
 
 embedded_imgs =                                                \
        gnumeric.css                                    \
-       pixmaps/cursor_cross.xpm                        \
        pixmaps/down-right.png                          \
        pixmaps/gnumeric_splash_1.4.png                 \
        pixmaps/line_pattern_dash_dot.xpm               \
diff --git a/src/application.c b/src/application.c
index 4537ecc..80eb454 100644
--- a/src/application.c
+++ b/src/application.c
@@ -745,64 +745,6 @@ gnumeric_application_get_property (GObject *obj, guint param_id,
 }
 
 static void
-install_icons (GnmApp *app)
-{
-       static const char *icons[] = {
-               /* Cursors */
-               "cursor_cross.xpm",
-               //"bucket.xpm",
-               //"font.xpm",
-               "sheet_move_marker.xpm",
-
-               "line_pattern_dash_dot.xpm",
-               "line_pattern_dash_dot_dot.xpm",
-               "line_pattern_dashed.xpm",
-               "line_pattern_dotted.xpm",
-               "line_pattern_double.xpm",
-               "line_pattern_hair.xpm",
-               "line_pattern_medium.xpm",
-               "line_pattern_medium_dash.xpm",
-               "line_pattern_medium_dash_dot.xpm",
-               "line_pattern_medium_dash_dot_dot.xpm",
-               "line_pattern_slant.xpm",
-               "line_pattern_thick.xpm",
-               "line_pattern_thin.xpm",
-       };
-
-       GtkIconFactory *factory = gtk_icon_factory_new ();
-       unsigned int ui;
-
-       for (ui = 0; ui < G_N_ELEMENTS (icons); ui++) {
-               const char *filename = icons[ui];
-               char *res = g_strconcat ("res:gnm:pixmaps/", filename, NULL);
-               char *iconname;
-               GdkPixbuf *pixbuf = go_gdk_pixbuf_load_from_file (res);
-
-               if (!pixbuf) {
-                       g_warning ("Misssing icon %s\n", filename);
-                       continue;
-               }
-
-               iconname = g_strdup (filename);
-               strchr(iconname, '.')[0] = 0;
-               gtk_icon_theme_add_builtin_icon (iconname,
-                                                gdk_pixbuf_get_width (pixbuf),
-                                                pixbuf);
-
-               g_object_unref (pixbuf);
-               g_free (iconname);
-               g_free (res);
-       }
-
-       gtk_icon_factory_add_default (factory);
-       g_object_set_data_full (G_OBJECT (app),
-                               "icon-factory", factory,
-                               (GDestroyNotify)gtk_icon_factory_remove_default);
-       g_object_unref (factory);
-}
-
-
-static void
 gnm_app_class_init (GObjectClass *gobject_klass)
 {
        parent_klass = g_type_class_peek_parent (gobject_klass);
@@ -878,12 +820,6 @@ static void
 gnm_app_init (GObject *obj)
 {
        GnmApp *gnm_app = GNM_APP (obj);
-       static gboolean icons_installed = FALSE;
-
-       if (!icons_installed) {
-               icons_installed = TRUE;
-               install_icons (gnm_app);
-       }
 
        gnm_app->clipboard_copied_contents = NULL;
        gnm_app->clipboard_sheet_view = NULL;
diff --git a/src/dialogs/dialog-cell-format.c b/src/dialogs/dialog-cell-format.c
index 15fef05..1f9e3aa 100644
--- a/src/dialogs/dialog-cell-format.c
+++ b/src/dialogs/dialog-cell-format.c
@@ -304,7 +304,7 @@ setup_pattern_button (GdkScreen *screen,
                      GtkBuilder  *gui,
                      char const *const name,
                      PatternPicker *picker,
-                     gboolean const flag,
+                     gboolean const do_icon,
                      int const index,
                      int const select_index,
                      unsigned size)
@@ -312,12 +312,10 @@ setup_pattern_button (GdkScreen *screen,
        GtkWidget *tmp = go_gtk_builder_get_widget (gui, name);
        if (tmp != NULL) {
                GtkButton *button = GTK_BUTTON (tmp);
-               if (flag) {
-                       GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (
-                               gtk_icon_theme_get_for_screen (screen),
-                               name, size, 0, NULL);
-                       GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
-                       g_object_unref (pixbuf);
+               if (do_icon) {
+                       char *res = g_strconcat ("/org/gnumeric/gnumeric/images/", name, ".xpm", NULL);
+                       GtkWidget *image = gtk_image_new_from_resource (res);
+                       g_free (res);
                        gtk_widget_show (image);
                        gtk_container_add (GTK_CONTAINER (tmp), image);
                }
diff --git a/src/gnm.gresource.xml b/src/gnm.gresource.xml
index 10a0ea6..d0464b1 100644
--- a/src/gnm.gresource.xml
+++ b/src/gnm.gresource.xml
@@ -152,6 +152,20 @@
     <file>icons/24x24/actions/gnumeric-subscript.png</file>
     <file>icons/24x24/actions/gnumeric-superscript.png</file>
     <file>icons/24x24/actions/gnumeric-ungroup.xpm</file>
+    <file>icons/32x32/actions/cursor-cross.xpm</file>
     <file>icons/48x48/actions/gnumeric-protection-yes-dialog.png</file>
+    <file alias="images/line_pattern_dash_dot.xpm">src/pixmaps/line_pattern_dash_dot.xpm</file>
+    <file alias="images/line_pattern_dash_dot_dot.xpm">src/pixmaps/line_pattern_dash_dot_dot.xpm</file>
+    <file alias="images/line_pattern_dashed.xpm">src/pixmaps/line_pattern_dashed.xpm</file>
+    <file alias="images/line_pattern_dotted.xpm">src/pixmaps/line_pattern_dotted.xpm</file>
+    <file alias="images/line_pattern_double.xpm">src/pixmaps/line_pattern_double.xpm</file>
+    <file alias="images/line_pattern_hair.xpm">src/pixmaps/line_pattern_hair.xpm</file>
+    <file alias="images/line_pattern_medium.xpm">src/pixmaps/line_pattern_medium.xpm</file>
+    <file alias="images/line_pattern_medium_dash.xpm">src/pixmaps/line_pattern_medium_dash.xpm</file>
+    <file alias="images/line_pattern_medium_dash_dot.xpm">src/pixmaps/line_pattern_medium_dash_dot.xpm</file>
+    <file 
alias="images/line_pattern_medium_dash_dot_dot.xpm">src/pixmaps/line_pattern_medium_dash_dot_dot.xpm</file>
+    <file alias="images/line_pattern_slant.xpm">src/pixmaps/line_pattern_slant.xpm</file>
+    <file alias="images/line_pattern_thick.xpm">src/pixmaps/line_pattern_thick.xpm</file>
+    <file alias="images/line_pattern_thin.xpm">src/pixmaps/line_pattern_thin.xpm</file>
   </gresource>
 </gresources>
diff --git a/src/item-grid.c b/src/item-grid.c
index f81e144..38cc48e 100644
--- a/src/item-grid.c
+++ b/src/item-grid.c
@@ -210,7 +210,7 @@ item_grid_realize (GocItem *item)
        ig->cursor_link  = gdk_cursor_new_for_display (display, GDK_HAND2);
        cursor_cross_pixbuf =
                gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
-                                         "cursor_cross", 32, 0, NULL);
+                                         "cursor-cross", 32, 0, NULL);
        ig->cursor_cross =
                gdk_cursor_new_from_pixbuf (display,
                                            cursor_cross_pixbuf,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]