[gitg/gtk3: 18/20] Port to GtkSourceMarkAttributes



commit ebddf2ab7365f2e8922b963298217f45eb119598
Author: Garrett Regier <alias301 gmail com>
Date:   Sat Jan 22 15:43:42 2011 -0800

    Port to GtkSourceMarkAttributes

 configure.ac            |    2 +-
 gitg/gitg-commit-view.c |   22 ++++++++++++++++++----
 2 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 471c730..1b075cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,7 @@ AC_CHECK_LIB([m], [sinf])
 
 GLIB_REQUIRED_VERSION=2.26
 GTK_REQUIRED_VERSION=2.90.0
-GTKSOURCEVIEW_REQUIRED_VERSION=2.90.0
+GTKSOURCEVIEW_REQUIRED_VERSION=2.91.4
 
 PKG_CHECK_MODULES(GITG, [
 	gtk+-3.0 >= $GTK_REQUIRED_VERSION
diff --git a/gitg/gitg-commit-view.c b/gitg/gitg-commit-view.c
index 7708f5e..ccdc18c 100644
--- a/gitg/gitg-commit-view.c
+++ b/gitg/gitg-commit-view.c
@@ -1365,6 +1365,8 @@ on_tag_added (GtkTextTagTable *table,
 static void
 gitg_commit_view_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
 {
+	GtkSourceMarkAttributes *attrs;
+
 	if (parent_iface.parser_finished)
 		parent_iface.parser_finished(buildable, builder);
 
@@ -1430,16 +1432,28 @@ gitg_commit_view_parser_finished(GtkBuildable *buildable, GtkBuilder *builder)
 
 	if (pixbuf)
 	{
-		gtk_source_view_set_mark_category_icon_from_pixbuf(self->priv->changes_view, CATEGORY_STAGE_HUNK, pixbuf);
-		g_object_unref(pixbuf);
+		attrs = gtk_source_mark_attributes_new ();
+		gtk_source_mark_attributes_set_pixbuf (attrs, pixbuf);
+
+		gtk_source_view_set_mark_attributes (self->priv->changes_view,
+		                                     CATEGORY_STAGE_HUNK,
+		                                     attrs, 1);
+
+		g_object_unref (pixbuf);
 	}
 
 	pixbuf = gtk_icon_theme_load_icon(theme, GTK_STOCK_REMOVE, 12, GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
 
 	if (pixbuf)
 	{
-		gtk_source_view_set_mark_category_icon_from_pixbuf(self->priv->changes_view, CATEGORY_UNSTAGE_HUNK, pixbuf);
-		g_object_unref(pixbuf);
+		attrs = gtk_source_mark_attributes_new ();
+		gtk_source_mark_attributes_set_pixbuf (attrs, pixbuf);
+
+		gtk_source_view_set_mark_attributes (self->priv->changes_view,
+		                                     CATEGORY_UNSTAGE_HUNK,
+		                                     attrs, 2);
+
+		g_object_unref (pixbuf);
 	}
 
 	gitg_utils_set_monospace_font(GTK_WIDGET(self->priv->changes_view));



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