[nautilus] editable-label: don't hardcode black for the insertion cursor
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] editable-label: don't hardcode black for the insertion cursor
- Date: Tue, 18 Oct 2011 13:37:39 +0000 (UTC)
commit f9383acb378762a80a373f124e059aff5e571f21
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Oct 17 18:45:35 2011 -0400
editable-label: don't hardcode black for the insertion cursor
Use the theme foreground/text color instead.
eel/eel-editable-label.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/eel/eel-editable-label.c b/eel/eel-editable-label.c
index 3594ad8..11e89a4 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]