aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-15 21:43:31 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-15 23:47:25 +0800
commit676e1f544d851935cb2dc7781f4a5ff39c366b2f (patch)
tree74cc72005f0ddfe023bc5ad172d01ec22dde9a4b
parent46f7d3a0152fd23d15c707d851e9b1889fc512f0 (diff)
downloadgsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar.gz
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar.bz2
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar.lz
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar.xz
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.tar.zst
gsoc2013-empathy-676e1f544d851935cb2dc7781f4a5ff39c366b2f.zip
factor out empathy_make_color_whiter()
-rw-r--r--libempathy-gtk/empathy-account-widget.c5
-rw-r--r--libempathy-gtk/empathy-ui-utils.c10
-rw-r--r--libempathy-gtk/empathy-ui-utils.h3
3 files changed, 14 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 7df208a79..ea1572021 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -235,7 +235,6 @@ account_widget_set_entry_highlighting (GtkEntry *entry,
{
GtkStyleContext *style;
GdkRGBA color;
- const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
style = gtk_widget_get_style_context (GTK_WIDGET (entry));
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
@@ -246,9 +245,7 @@ account_widget_set_entry_highlighting (GtkEntry *entry,
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (white).red) / 2;
- color.green = (color.green + (white).green) / 2;
- color.blue = (color.blue + (white).blue) / 2;
+ empathy_make_color_whiter (&color);
gtk_widget_override_background_color (GTK_WIDGET (entry), 0, &color);
}
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 043c03eb3..d7abb9a5e 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1898,3 +1898,13 @@ empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler)
gtk_widget_show (widget);
g_free (title);
}
+
+void
+empathy_make_color_whiter (GdkRGBA *color)
+{
+ const GdkRGBA white = { 1.0, 1.0, 1.0, 1.0 };
+
+ color->red = (color->red + (white).red) / 2;
+ color->green = (color->green + (white).green) / 2;
+ color->blue = (color->blue + (white).blue) / 2;
+}
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 0b76d09a3..0ff637a33 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -145,6 +145,9 @@ void empathy_send_file_from_uri_list (EmpathyContact *conta
void empathy_send_file_with_file_chooser (EmpathyContact *contact);
void empathy_receive_file_with_file_chooser (EmpathyFTHandler *handler);
+/* Misc */
+void empathy_make_color_whiter (GdkRGBA *color);
+
G_END_DECLS
#endif /* __EMPATHY_UI_UTILS_H__ */