summaryrefslogtreecommitdiff
path: root/libcaja-private
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-07 23:53:55 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:05:42 +0100
commit01e61137a215658271f8b727ba56b8b2272fe1b2 (patch)
treea00bead71083a5b3dd48a87d4ef2010f2262092a /libcaja-private
parentc8c302522c9692e616611def4594c8f7364e79d2 (diff)
downloadcaja-01e61137a215658271f8b727ba56b8b2272fe1b2.tar.bz2
caja-01e61137a215658271f8b727ba56b8b2272fe1b2.tar.xz
GTK3 icon-canvas-item: set the right style class
taken from: https://git.gnome.org/browse/nautilus/commit/?h=gnome-3-0&id=0668960
Diffstat (limited to 'libcaja-private')
-rw-r--r--libcaja-private/caja-icon-canvas-item.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c
index 1249cba6..476b8839 100644
--- a/libcaja-private/caja-icon-canvas-item.c
+++ b/libcaja-private/caja-icon-canvas-item.c
@@ -1587,7 +1587,17 @@ draw_label_text (CajaIconCanvasItem *item,
if (!create_mask && item->details->is_highlighted_as_keyboard_focus)
{
#if GTK_CHECK_VERSION(3,0,0)
- 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,
#else
gtk_paint_focus (gtk_widget_get_style (GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas)),
@@ -1601,6 +1611,10 @@ draw_label_text (CajaIconCanvasItem *item,
text_rect.y0,
text_rect.x1 - text_rect.x0,
text_rect.y1 - text_rect.y0);
+#if GTK_CHECK_VERSION(3,0,0)
+
+ gtk_style_context_restore (style);
+#endif
}
if (editable_layout != NULL)