From 654aaea6780716ff7973530859d2b1b86e2f7ca3 Mon Sep 17 00:00:00 2001 From: Marco Barisione Date: Mon, 6 May 2013 17:04:23 +0100 Subject: [PATCH] tpaw-utils: copy empathy_make_color_whiter() This commit also changes the licence of the moved code from GPL to LGPL. See GOSSIP-RELICENSING.txt for details. https://bugzilla.gnome.org/show_bug.cgi?id=699492 --- tp-account-widgets/tpaw-account-widget.c | 4 ++-- tp-account-widgets/tpaw-utils.c | 10 ++++++++++ tp-account-widgets/tpaw-utils.h | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/tp-account-widgets/tpaw-account-widget.c b/tp-account-widgets/tpaw-account-widget.c index 2cb41cbe..20eb64f6 100644 --- a/tp-account-widgets/tpaw-account-widget.c +++ b/tp-account-widgets/tpaw-account-widget.c @@ -29,13 +29,13 @@ #include #include -#include #include "tpaw-account-widget-irc.h" #include "tpaw-account-widget-private.h" #include "tpaw-account-widget-sip.h" #include "empathy-ui-utils.h" #include "empathy-utils.h" +#include "tpaw-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT #include "empathy-debug.h" @@ -229,7 +229,7 @@ account_widget_set_entry_highlighting (GtkEntry *entry, * gives a colour which is inline with the theme but * slightly whiter. */ - empathy_make_color_whiter (&color); + tpaw_make_color_whiter (&color); gtk_widget_override_background_color (GTK_WIDGET (entry), 0, &color); } diff --git a/tp-account-widgets/tpaw-utils.c b/tp-account-widgets/tpaw-utils.c index 3efc422b..b373dac9 100644 --- a/tp-account-widgets/tpaw-utils.c +++ b/tp-account-widgets/tpaw-utils.c @@ -156,3 +156,13 @@ tpaw_service_name_to_display_name (const gchar *service_name) return service_name; } + +void +tpaw_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/tp-account-widgets/tpaw-utils.h b/tp-account-widgets/tpaw-utils.h index b11fa767..d38a7a7b 100644 --- a/tp-account-widgets/tpaw-utils.h +++ b/tp-account-widgets/tpaw-utils.h @@ -24,6 +24,7 @@ #define __TPAW_UTILS_H__ #include +#include #include G_BEGIN_DECLS @@ -35,6 +36,8 @@ gchar *tpaw_protocol_icon_name (const gchar *protocol); const gchar *tpaw_protocol_name_to_display_name (const gchar *proto_name); const gchar *tpaw_service_name_to_display_name (const gchar *proto_name); +void tpaw_make_color_whiter (GdkRGBA *color); + G_END_DECLS #endif /* __TPAW_UTILS_H__ */ -- 2.39.2