[gtksourceview] StyleScheme: fix bug in secondary cursor color
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] StyleScheme: fix bug in secondary cursor color
- Date: Sat, 26 Mar 2016 14:10:03 +0000 (UTC)
commit e829ae10b18df3b2d439f38315328fef1846dc2a
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Mar 26 15:01:00 2016 +0100
StyleScheme: fix bug in secondary cursor color
Follow what is described in the Style Scheme Definition Reference.
In fact it gives better results, but it's not perfect.
gtksourceview/gtksourcestylescheme.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index c5297b2..b9da919 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -707,11 +707,11 @@ get_cursors_css_style (GtkSourceStyleScheme *scheme,
gtk_style_context_restore (context);
- /* shade the secondary cursor */
- secondary_color.red = background_color->red * 0.5;
- secondary_color.green = background_color->green * 0.5;
- secondary_color.blue = background_color->blue * 0.5;
- secondary_color.alpha = 1.0;
+ /* Blend primary cursor color with background color. */
+ secondary_color.red = (primary_color.red + background_color->red) * 0.5;
+ secondary_color.green = (primary_color.green + background_color->green) * 0.5;
+ secondary_color.blue = (primary_color.blue + background_color->blue) * 0.5;
+ secondary_color.alpha = (primary_color.alpha + background_color->alpha) * 0.5;
gdk_rgba_free (background_color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]