aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r--libempathy-gtk/empathy-account-widget.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index d2a1c56f4..ea1572021 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -226,32 +226,33 @@ account_widget_set_control_buttons_sensitivity (EmpathyAccountWidget *self,
}
static void
-account_widget_set_entry_highlighting (GtkEntry *entry, gboolean highlight)
+account_widget_set_entry_highlighting (GtkEntry *entry,
+ gboolean highlight)
{
- GdkColor color;
- GtkStyle *style;
-
g_return_if_fail (GTK_IS_ENTRY (entry));
- style = gtk_widget_get_style (GTK_WIDGET (entry));
-
if (highlight)
{
- color = style->bg[GTK_STATE_SELECTED];
+ GtkStyleContext *style;
+ GdkRGBA color;
+
+ style = gtk_widget_get_style_context (GTK_WIDGET (entry));
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
+ &color);
/* Here we take the current theme colour and add it to
* the colour for white and average the two. This
* gives a colour which is inline with the theme but
* slightly whiter.
*/
- color.red = (color.red + (style->white).red) / 2;
- color.green = (color.green + (style->white).green) / 2;
- color.blue = (color.blue + (style->white).blue) / 2;
+ empathy_make_color_whiter (&color);
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, &color);
+ gtk_widget_override_background_color (GTK_WIDGET (entry), 0, &color);
}
else
- gtk_widget_modify_base (GTK_WIDGET (entry), GTK_STATE_NORMAL, NULL);
+ {
+ gtk_widget_override_background_color (GTK_WIDGET (entry), 0, NULL);
+ }
}
static void