[nautilus: 12/18] location-bar: port to GtkStyleContext



commit 5fc40adf98a384f4638401d7b7ced79da6ce2b87
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Dec 6 15:53:14 2010 +0100

    location-bar: port to GtkStyleContext

 src/nautilus-location-bar.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c
index ce32b1a..a06e04b 100644
--- a/src/nautilus-location-bar.c
+++ b/src/nautilus-location-bar.c
@@ -573,16 +573,16 @@ nautilus_location_bar_update_label (NautilusLocationBar *bar)
 void
 nautilus_location_bar_set_active(NautilusLocationBar *location_bar, gboolean is_active)
 {
-	if(is_active) {
+	if (is_active) {
 		/* reset style to default */
-		gtk_widget_modify_base (GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, NULL);
-	}
-	else {
-		GtkStyle *style;
-		GdkColor color;
-		style = gtk_widget_get_style (GTK_WIDGET (location_bar->details->entry));
-		color = style->base[GTK_STATE_INSENSITIVE];
-		gtk_widget_modify_base(GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, &color);
+		gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_ACTIVE, NULL);
+	} else {
+		GtkStyleContext *style;
+		GdkRGBA color;
+
+		style = gtk_widget_get_style_context (GTK_WIDGET (location_bar->details->entry));
+		gtk_style_context_get_background_color (style, GTK_STATE_FLAG_INSENSITIVE, &color);
+		gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_ACTIVE, &color);
 	}
 }
 



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