[libdazzle] util: add helper to remove style class



commit fc608d1b9a736c69fd4e7bde331720ba54579fb4
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jul 22 19:32:07 2017 -0700

    util: add helper to remove style class

 src/util/dzl-gtk.c |   10 ++++++++++
 src/util/dzl-gtk.h |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/util/dzl-gtk.c b/src/util/dzl-gtk.c
index ee4fbbf..cf2d7ae 100644
--- a/src/util/dzl-gtk.c
+++ b/src/util/dzl-gtk.c
@@ -330,6 +330,16 @@ dzl_gtk_widget_add_style_class (GtkWidget   *widget,
 }
 
 void
+dzl_gtk_widget_remove_style_class (GtkWidget   *widget,
+                                   const gchar *class_name)
+{
+  g_return_if_fail (GTK_IS_WIDGET (widget));
+  g_return_if_fail (class_name != NULL);
+
+  gtk_style_context_remove_class (gtk_widget_get_style_context (widget), class_name);
+}
+
+void
 dzl_gtk_widget_action_set (GtkWidget   *widget,
                            const gchar *group,
                            const gchar *name,
diff --git a/src/util/dzl-gtk.h b/src/util/dzl-gtk.h
index 42a0a0f..4a4f485 100644
--- a/src/util/dzl-gtk.h
+++ b/src/util/dzl-gtk.h
@@ -43,6 +43,8 @@ void          dzl_gtk_widget_hide_with_fade          (GtkWidget               *w
 void          dzl_gtk_widget_show_with_fade          (GtkWidget               *widget);
 void          dzl_gtk_widget_add_style_class         (GtkWidget               *widget,
                                                       const gchar             *class_name);
+void          dzl_gtk_widget_remove_style_class      (GtkWidget               *widget,
+                                                      const gchar             *class_name);
 gpointer      dzl_gtk_widget_find_child_typed        (GtkWidget               *widget,
                                                       GType                    type);
 void          dzl_gtk_text_buffer_remove_tag         (GtkTextBuffer           *buffer,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]