Commit 667f7428 authored by Morten Welinder's avatar Morten Welinder

Icons: Part IV.

parent 86622841
......@@ -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
......
internalicons =
EXTRA_DIST = $(internalicons)
......@@ -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 \
......
......@@ -744,64 +744,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)
{
......@@ -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;
......
......@@ -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);
}
......
......@@ -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>
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment