[gedit] Remove the css custom provider for not-found



commit e1df47651a7bf8d18e8cb49f07d468a311eccfe8
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jan 22 12:25:55 2012 +0100

    Remove the css custom provider for not-found
    
    Simply set a class instead and let the theme do its magic

 gedit/gedit-view-frame.c |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)
---
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index 9c89b93..a387107 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -81,11 +81,6 @@ struct _GeditViewFramePrivate
 	guint        wrap_around : 1;
 };
 
-struct _GeditViewFrameClassPrivate
-{
-	GtkCssProvider *search_css;
-};
-
 enum
 {
 	PROP_0,
@@ -99,8 +94,7 @@ typedef enum
 	GEDIT_SEARCH_ENTRY_NOT_FOUND
 } GeditSearchEntryBgColor;
 
-G_DEFINE_TYPE_WITH_CODE (GeditViewFrame, gedit_view_frame, GTK_TYPE_BOX,
-                         g_type_add_class_private (g_define_type_id, sizeof (GeditViewFrameClassPrivate)))
+G_DEFINE_TYPE (GeditViewFrame, gedit_view_frame, GTK_TYPE_BOX)
 
 static void
 gedit_view_frame_finalize (GObject *object)
@@ -230,14 +224,11 @@ set_entry_background (GeditViewFrame          *frame,
 
 	if (col == GEDIT_SEARCH_ENTRY_NOT_FOUND)
 	{
-		gtk_style_context_add_provider (context,
-		                                GTK_STYLE_PROVIDER (GEDIT_VIEW_FRAME_GET_CLASS (frame)->priv->search_css),
-		                                GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+		gtk_style_context_add_class (context, "not-found");
 	}
-	else /* reset */
+	else
 	{
-		gtk_style_context_remove_provider (context,
-		                                   GTK_STYLE_PROVIDER (GEDIT_VIEW_FRAME_GET_CLASS (frame)->priv->search_css));
+		gtk_style_context_remove_class (context, "not-found");
 	}
 }
 
@@ -1216,9 +1207,6 @@ static void
 gedit_view_frame_class_init (GeditViewFrameClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	static const gchar error_style[] =
-		"@define-color text_color @error_fg_color;\n"
-		"@define-color base_color @error_bg_color;\n";
 
 	object_class->finalize = gedit_view_frame_finalize;
 	object_class->dispose = gedit_view_frame_dispose;
@@ -1241,11 +1229,6 @@ gedit_view_frame_class_init (GeditViewFrameClass *klass)
 	                                                      G_PARAM_STATIC_STRINGS));
 
 	g_type_class_add_private (object_class, sizeof (GeditViewFramePrivate));
-
-	klass->priv = G_TYPE_CLASS_GET_PRIVATE (klass, GEDIT_TYPE_VIEW_FRAME, GeditViewFrameClassPrivate);
-
-	klass->priv->search_css = gtk_css_provider_new ();
-	gtk_css_provider_load_from_data (klass->priv->search_css, error_style, -1, NULL);
 }
 
 static GMountOperation *



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