[libchamplain] Use sane color selection values when the obtained one aren't
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Use sane color selection values when the obtained one aren't
- Date: Tue, 7 May 2013 21:53:52 +0000 (UTC)
commit 9fa0a319aff8cf7bdd4b3bbf3cd25ad08034121e
Author: Jiří Techet <techet gmail com>
Date: Tue May 7 23:53:37 2013 +0200
Use sane color selection values when the obtained one aren't
champlain-gtk/gtk-champlain-embed.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/champlain-gtk/gtk-champlain-embed.c b/champlain-gtk/gtk-champlain-embed.c
index 7cf5f79..c6e73a9 100644
--- a/champlain-gtk/gtk-champlain-embed.c
+++ b/champlain-gtk/gtk-champlain-embed.c
@@ -287,9 +287,23 @@ view_realize_cb (GtkWidget *widget,
style = gtk_widget_get_style (widget);
gdk_to_clutter_color (&style->text[GTK_STATE_SELECTED], &color);
+ if (color.alpha == 0 && color.red == 0 && color.green == 0 && color.blue == 0)
+ {
+ color.red = 255;
+ color.green = 255;
+ color.blue = 255;
+ }
champlain_marker_set_selection_text_color (&color);
gdk_to_clutter_color (&style->bg[GTK_STATE_SELECTED], &color);
+ if (color.alpha == 0)
+ color.alpha = 255;
+ if (color.red == 0 && color.green == 0 && color.blue == 0)
+ {
+ color.red = 75;
+ color.green = 105;
+ color.blue = 131;
+ }
champlain_marker_set_selection_color (&color);
#else
GtkStyleContext *style;
@@ -300,10 +314,24 @@ view_realize_cb (GtkWidget *widget,
gtk_style_context_get_color (style, GTK_STATE_FLAG_SELECTED, &gdk_rgba_color);
gdk_rgba_to_clutter_color (&gdk_rgba_color, &color);
+ if (color.alpha == 0 && color.red == 0 && color.green == 0 && color.blue == 0)
+ {
+ color.red = 255;
+ color.green = 255;
+ color.blue = 255;
+ }
champlain_marker_set_selection_text_color (&color);
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED, &gdk_rgba_color);
gdk_rgba_to_clutter_color (&gdk_rgba_color, &color);
+ if (color.alpha == 0)
+ color.alpha = 255;
+ if (color.red == 0 && color.green == 0 && color.blue == 0)
+ {
+ color.red = 75;
+ color.green = 105;
+ color.blue = 131;
+ }
champlain_marker_set_selection_color (&color);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]