summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-10-03 06:38:21 +0200
committerBenjamin Otte <otte@redhat.com>2014-10-03 06:38:21 +0200
commit2fbc77fce11079beebfc9d5f1992980b34328984 (patch)
tree2a17f56494add0c1006c97f907d28797165675fc
parenta2f550d91ba4e4ee8ab5232694858b81c1e7aa3e (diff)
downloadgtk+-2fbc77fce11079beebfc9d5f1992980b34328984.tar.gz
gtk-demo: Properly override font color in combobox example
-rw-r--r--demos/gtk-demo/combobox.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c
index cf20621ac4..f78ee82422 100644
--- a/demos/gtk-demo/combobox.c
+++ b/demos/gtk-demo/combobox.c
@@ -259,18 +259,21 @@ G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY,
static void
mask_entry_set_background (MaskEntry *entry)
{
- static const GdkRGBA error_color = { 1.0, 0.9, 0.9, 1.0 };
-
if (entry->mask)
{
if (!g_regex_match_simple (entry->mask, gtk_entry_get_text (GTK_ENTRY (entry)), 0, 0))
{
- gtk_widget_override_color (GTK_WIDGET (entry), 0, &error_color);
+ PangoAttrList *attrs;
+
+ attrs = pango_attr_list_new ();
+ pango_attr_list_insert (attrs, pango_attr_foreground_new (65535, 32767, 32767));
+ gtk_entry_set_attributes (GTK_ENTRY (entry), attrs);
+ pango_attr_list_unref (attrs);
return;
}
}
- gtk_widget_override_color (GTK_WIDGET (entry), 0, NULL);
+ gtk_entry_set_attributes (GTK_ENTRY (entry), NULL);
}