summaryrefslogtreecommitdiff
path: root/plugins/ropgadgets/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ropgadgets/select.c')
-rw-r--r--plugins/ropgadgets/select.c14
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"));