[gedit-plugins] bookmarks: use the bookmark symbolic icon.



commit 47439b305e78e8e4ccfa1c2562c0d34a408a1068
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Jan 5 00:19:14 2013 +0100

    bookmarks: use the bookmark symbolic icon.

 plugins/bookmarks/Makefile.am              |    5 +----
 plugins/bookmarks/bookmark.png             |  Bin 438 -> 0 bytes
 plugins/bookmarks/gedit-bookmarks-plugin.c |   22 +++++++++++++++-------
 3 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/plugins/bookmarks/Makefile.am b/plugins/bookmarks/Makefile.am
index 9b26409..df5f97f 100644
--- a/plugins/bookmarks/Makefile.am
+++ b/plugins/bookmarks/Makefile.am
@@ -1,6 +1,5 @@
 # Advanced Editing plugin
 plugindir = $(GEDIT_PLUGINS_LIBS_DIR)
-supportdir = $(GEDIT_PLUGINS_DATA_DIR)/bookmarks
 
 INCLUDES = \
 	-I$(top_srcdir) 				\
@@ -28,8 +27,6 @@ libbookmarks_la_SOURCES = \
 libbookmarks_la_LDFLAGS = $(PLUGIN_LIBTOOL_FLAGS)
 libbookmarks_la_LIBADD = $(GEDIT_LIBS)
 
-support_DATA = bookmark.png
-
 # Plugin Info
 plugin_in_files = bookmarks.plugin.desktop.in
 
@@ -39,7 +36,7 @@ BUILDFILES = $(plugin_in_files:.plugin.desktop.in=.plugin)
 
 plugin_DATA = $(BUILDFILES)
 
-EXTRA_DIST = $(plugin_in_files) $(support_DATA)
+EXTRA_DIST = $(plugin_in_files)
 
 CLEANFILES = $(BUILDFILES) 
 DISTCLEANFILES = $(BUILDFILES)
diff --git a/plugins/bookmarks/gedit-bookmarks-plugin.c b/plugins/bookmarks/gedit-bookmarks-plugin.c
index 5d74452..c5ddd91 100644
--- a/plugins/bookmarks/gedit-bookmarks-plugin.c
+++ b/plugins/bookmarks/gedit-bookmarks-plugin.c
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
+#include <gtksourceview/gtksource.h>
 #include <gedit/gedit-debug.h>
 #include <gedit/gedit-window.h>
 #include <gedit/gedit-window-activatable.h>
@@ -299,16 +300,23 @@ disable_bookmarks (GeditView *view)
 static GdkPixbuf *
 get_bookmark_pixbuf (GeditBookmarksPlugin *plugin)
 {
-	gchar *datadir;
-	gchar *iconpath;
 	GdkPixbuf *pixbuf;
+	gint width;
+	GError *error = NULL;
 
-	datadir = peas_extension_base_get_data_dir (PEAS_EXTENSION_BASE (plugin));
-	iconpath = g_build_filename (datadir, "bookmark.png", NULL);
-	pixbuf = gdk_pixbuf_new_from_file (iconpath, NULL);
+	gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, NULL);
+	pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+	                                   "user-bookmarks-symbolic",
+	                                   (width * 2) / 3,
+	                                   0,
+	                                   &error);
 
-	g_free (datadir);
-	g_free (iconpath);
+	if (error != NULL)
+	{
+		g_warning ("Could not load theme icon user-bookmarks-symbolic: %s",
+		           error->message);
+		g_error_free (error);
+	}
 
 	return pixbuf;
 }



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