From 320f2ba8857395caf57bf670be36bb0e215971fe Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan Date: Thu, 7 Jun 2007 20:06:41 +0000 Subject: [PATCH] Merge from trunk (#445196): 2007-06-07 Yevgen Muntyan Merge from trunk (#445196): * gtk/gtkstyle.c (get_insertion_cursor_gc): use text colors from widget style to draw cursor instead of hardcoded black and grey (#79585, comment #30). svn path=/branches/gtk-2-10/; revision=18078 --- ChangeLog | 8 ++++++++ gtk/gtkstyle.c | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a16d1121cc..cde7772c7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-07 Yevgen Muntyan + + Merge from trunk (#445196): + + * gtk/gtkstyle.c (get_insertion_cursor_gc): use text colors from + widget style to draw cursor instead of hardcoded black and grey + (#79585, comment #30). + 2007-06-06 Johan Dahlin Merge from trunk: diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index ed177917b5..61ee7b79bd 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -6632,24 +6632,26 @@ get_insertion_cursor_gc (GtkWidget *widget, } } + /* Cursors in text widgets are drawn only in NORMAL state, + * so we can use text[GTK_STATE_NORMAL] as text color here */ if (is_primary) { if (!cursor_info->primary_gc) cursor_info->primary_gc = make_cursor_gc (widget, "cursor-color", - &widget->style->black); - + &widget->style->text[GTK_STATE_NORMAL]); + return cursor_info->primary_gc; } else { - static const GdkColor gray = { 0, 0x8888, 0x8888, 0x8888 }; - if (!cursor_info->secondary_gc) cursor_info->secondary_gc = make_cursor_gc (widget, "secondary-cursor-color", - &gray); - + /* text_aa is the average of text and base colors, + * in usual black-on-white case it's grey. */ + &widget->style->text_aa[GTK_STATE_NORMAL]); + return cursor_info->secondary_gc; } }