[nautilus] icon-canvas-item: set the right style class



commit 066896047e8d53076913994f9975ee1cb22fbd9d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Dec 14 01:21:27 2010 +0100

    icon-canvas-item: set the right style class

 libnautilus-private/nautilus-icon-canvas-item.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c
index 017288d..cabeba9 100644
--- a/libnautilus-private/nautilus-icon-canvas-item.c
+++ b/libnautilus-private/nautilus-icon-canvas-item.c
@@ -1281,12 +1281,24 @@ draw_label_text (NautilusIconCanvasItem *item,
 	}
 
 	if (!create_mask && item->details->is_highlighted_as_keyboard_focus) {
-		gtk_render_focus (gtk_widget_get_style_context (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas)),
+		GtkStyleContext *style;
+
+		style = gtk_widget_get_style_context (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas));
+
+		gtk_style_context_save (style);
+		gtk_style_context_add_class (style, "icon-container");
+		gtk_style_context_set_state (style,
+					     needs_highlight ?
+					     GTK_STATE_FLAG_SELECTED : GTK_STATE_FLAG_ACTIVE);
+					     
+		gtk_render_focus (style,
 				  cr,
 				  text_rect.x0,
 				  text_rect.y0,
 				  text_rect.x1 - text_rect.x0,
 				  text_rect.y1 - text_rect.y0);
+
+		gtk_style_context_restore (style);
 	}
 
 	if (editable_layout != NULL) {



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