diff options
author | Yevgen Muntyan <muntyan@tamu.edu> | 2007-06-01 05:02:05 +0000 |
---|---|---|
committer | Yevgen Muntyan <muntyan@src.gnome.org> | 2007-06-01 05:02:05 +0000 |
commit | 405df7f7dbae2e6e70063f944b1415072f161ed3 (patch) | |
tree | 7bf96b67ba78df5ebfe8d4c79981de79ea468f51 /gtk/gtkstyle.c | |
parent | 5fc26ddab7c7e8d1abfd20a1b7cbc810f6ce3e10 (diff) | |
download | gtk+-405df7f7dbae2e6e70063f944b1415072f161ed3.tar.gz |
use text colors from widget style to draw cursor instead of hardcoded
2007-05-31 Yevgen Muntyan <muntyan@tamu.edu>
* 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=/trunk/; revision=17998
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r-- | gtk/gtkstyle.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index a673e4fcfd..763cc37086 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -6641,24 +6641,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; } } |