[nautilus] icon-dnd: set the right style class, and use GdkRGBA



commit 5d811bb37ef4a05edd7fa4c5868a9b68f717e056
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Dec 14 01:58:59 2010 +0100

    icon-dnd: set the right style class, and use GdkRGBA

 libnautilus-private/nautilus-icon-dnd.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-dnd.c b/libnautilus-private/nautilus-icon-dnd.c
index 3ae4f05..c407210 100644
--- a/libnautilus-private/nautilus-icon-dnd.c
+++ b/libnautilus-private/nautilus-icon-dnd.c
@@ -131,6 +131,7 @@ create_selection_shadow (NautilusIconContainer *container,
 	for (p = list; p != NULL; p = p->next) {
 		NautilusDragSelectionItem *item;
 		int x1, y1, x2, y2;
+		GdkRGBA black = { 0, 0, 0, 1 };
 
 		item = p->data;
 
@@ -151,7 +152,7 @@ create_selection_shadow (NautilusIconContainer *container,
 				 "y1", (double) y1,
 				 "x2", (double) x2,
 				 "y2", (double) y2,
-				 "outline_color", "black",
+				 "outline-color-rgba", &black,
 				 "outline-stippling", TRUE,
 				 "width_pixels", 1,
 				 NULL);
@@ -1359,15 +1360,24 @@ drag_highlight_draw (GtkWidget *widget,
 {
 	gint width, height;
 	GdkWindow *window;
+	GtkStyleContext *style;
 	
         window = gtk_widget_get_window (widget);
         width = gdk_window_get_width (window);
         height = gdk_window_get_height (window);
 
-	gtk_render_frame (gtk_widget_get_style_context (widget),
-                          cr,
+	style = gtk_widget_get_style_context (widget);
+
+	gtk_style_context_save (style);
+	gtk_style_context_add_class (style, "dnd");
+	gtk_style_context_set_state (style, GTK_STATE_FLAG_FOCUSED);
+
+	gtk_render_frame (style,
+			  cr,
 			  0, 0, width, height);
 
+	gtk_style_context_restore (style);
+
 	cairo_set_line_width (cr, 1.0);
 	cairo_set_source_rgb (cr, 0, 0, 0);
 	cairo_rectangle (cr, 0.5, 0.5, width - 1, height - 1);



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