summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-09 20:31:36 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:05:43 +0100
commit930436556075111dc13d4c8d8d270a3c89a9cd13 (patch)
tree16d17919af4766763b076087bfab25486eb6a1c2 /eel
parent59d1c9281e80922c2bda883c4635379022beb375 (diff)
downloadcaja-930436556075111dc13d4c8d8d270a3c89a9cd13.tar.bz2
caja-930436556075111dc13d4c8d8d270a3c89a9cd13.tar.xz
GTK3 editable-label: don't hardcode black for the insertion cursor
Use the theme foreground/text color instead. taken from: https://git.gnome.org/browse/nautilus/commit/?id=f9383ac
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-editable-label.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 9f2fd3a3..06948610 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1601,15 +1601,23 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
}
else /* Block cursor */
{
+#if GTK_CHECK_VERSION(3,0,0)
+ GdkRGBA fg_color;
+ GtkStyleContext *style;
cairo_region_t *clip;
-#if GTK_CHECK_VERSION(3,0,0)
+ style = gtk_widget_get_style_context (widget);
+ gtk_style_context_get_color (style, GTK_STATE_FLAG_NORMAL, &fg_color);
+
cairo_save (cr);
+ gdk_cairo_set_source_rgba (cr, &fg_color);
#else
+ cairo_region_t *clip;
+
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
-#endif
cairo_set_source_rgb (cr, 0, 0, 0);
+#endif
cairo_rectangle (cr,
xoffset + PANGO_PIXELS (strong_pos.x),
yoffset + PANGO_PIXELS (strong_pos.y),
@@ -1622,7 +1630,6 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
if (!block_at_line_end)
{
#if GTK_CHECK_VERSION(3,0,0)
- GtkStyleContext *style;
GdkRGBA color;
#endif
@@ -1634,7 +1641,6 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, gint xoffset, gint yof
cairo_clip (cr);
#if GTK_CHECK_VERSION(3,0,0)
- style = gtk_widget_get_style_context (widget);
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_FOCUSED,
&color);