diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-12-29 16:37:40 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-12-29 16:37:40 (GMT) |
commit | 8d4ec01c81c7f4ccad89ed53d2f34acabec4f595 (patch) | |
tree | 7d9072d8086b8a8dbf1cbf5dc18ab489db0ea0af /plugins | |
parent | e819784e1a9f2d997f5908af4c1c17962f96fc7c (diff) |
Killed the last uses of the deprecated gtk_widget_override_color() function.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ropgadgets/select.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/ropgadgets/select.c b/plugins/ropgadgets/select.c index 92456e7..2294a9c 100644 --- a/plugins/ropgadgets/select.c +++ b/plugins/ropgadgets/select.c @@ -1605,34 +1605,30 @@ static void on_rop_gadgets_filter_changed(GtkSearchEntry *entry, GObject *ref) { regex_t preg; /* Expression régulière de test*/ const gchar *text; /* Texte de l'utilisateur */ + GtkStyleContext *context; /* Contexte du thème actuel */ int ret; /* Bilan de mise en place */ - GdkRGBA error; /* Couleur d'erreur */ GtkTreeView *treeview; /* Arborescence à actualiser */ GtkTreeModelFilter *filter; /* Modèle de gestion associé */ text = gtk_entry_get_text(GTK_ENTRY(entry)); + context = gtk_widget_get_style_context(GTK_WIDGET(entry)); + if (text[0] != '\0') { ret = regcomp(&preg, text, REG_EXTENDED); if (ret != 0) { - error.red = 1.0; - error.green = 0.0; - error.blue = 0.0; - error.alpha = 1.0; - gtk_widget_override_color(GTK_WIDGET(entry), GTK_STATE_NORMAL, &error); - + gtk_style_context_add_class(context, "filter-error"); return; - } regfree(&preg); } - gtk_widget_override_color(GTK_WIDGET(entry), GTK_STATE_NORMAL, NULL); + gtk_style_context_remove_class(context, "filter-error"); treeview = GTK_TREE_VIEW(g_object_get_data(ref, "treeview")); |