summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2011-10-17 18:45:35 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2011-10-17 18:45:35 -0400
commitf9383acb378762a80a373f124e059aff5e571f21 (patch)
tree612335e0fefbd20d1465739f035f0e2b66478923 /eel
parent3f95c46dff1c4f71f67d2733f0487350139775cf (diff)
downloadnautilus-f9383acb378762a80a373f124e059aff5e571f21.tar.gz
editable-label: don't hardcode black for the insertion cursor
Use the theme foreground/text color instead.
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-editable-label.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 3594ad8fb..11e89a4c2 100644
--- a/eel/eel-editable-label.c
+++ b/eel/eel-editable-label.c
@@ -1490,11 +1490,16 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
}
else /* Block cursor */
{
+ GdkRGBA fg_color;
+ GtkStyleContext *style;
cairo_region_t *clip;
+ 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);
- cairo_set_source_rgb (cr, 0, 0, 0);
cairo_rectangle (cr,
xoffset + PANGO_PIXELS (strong_pos.x),
yoffset + PANGO_PIXELS (strong_pos.y),
@@ -1504,7 +1509,6 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
if (!block_at_line_end)
{
- GtkStyleContext *style;
GdkRGBA color;
clip = gdk_pango_layout_get_clip_region (label->layout,
@@ -1514,7 +1518,6 @@ eel_editable_label_draw_cursor (EelEditableLabel *label, cairo_t *cr, gint xoff
gdk_cairo_region (cr, clip);
cairo_clip (cr);
- style = gtk_widget_get_style_context (widget);
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_FOCUSED,
&color);