aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-15 21:28:19 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-15 23:47:25 +0800
commit46f7d3a0152fd23d15c707d851e9b1889fc512f0 (patch)
treee8b9ab8d4818ab9139c5e1fb60b0dc43c1b5bf50 /libempathy-gtk
parent554b78890fd7c8c2b392c335ab3f49c7bc756b8a (diff)
downloadgsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar.gz
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar.bz2
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar.lz
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar.xz
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.tar.zst
gsoc2013-empathy-46f7d3a0152fd23d15c707d851e9b1889fc512f0.zip
account-widget: use new GTK+ style API (#636500)
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index d2a1c56f4..7df208a79 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -226,32 +226,36 @@ 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;
+ 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,
+ &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;
+ color.red = (color.red + (white).red) / 2;
+ color.green = (color.green + (white).green) / 2;
+ color.blue = (color.blue + (white).blue) / 2;
- 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