[gnome-builder] gtk: add helper to add a style class



commit 0473d91a73aa913c1438e3c10a060c44dd72306d
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jun 20 17:02:37 2016 -0700

    gtk: add helper to add a style class

 libide/util/ide-gtk.c |   10 ++++++++++
 libide/util/ide-gtk.h |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/libide/util/ide-gtk.c b/libide/util/ide-gtk.c
index 41b2650..eec79e4 100644
--- a/libide/util/ide-gtk.c
+++ b/libide/util/ide-gtk.c
@@ -405,3 +405,13 @@ ide_gtk_text_buffer_remove_tag (GtkTextBuffer     *buffer,
         }
     }
 }
+
+void
+ide_widget_add_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_add_class (gtk_widget_get_style_context (widget), class_name);
+}
diff --git a/libide/util/ide-gtk.h b/libide/util/ide-gtk.h
index df586c4..bcf75fa 100644
--- a/libide/util/ide-gtk.h
+++ b/libide/util/ide-gtk.h
@@ -42,6 +42,8 @@ void          ide_widget_set_context_handler (gpointer                 widget,
                                               IdeWidgetContextHandler  handler);
 void          ide_widget_hide_with_fade      (GtkWidget               *widget);
 void          ide_widget_show_with_fade      (GtkWidget               *widget);
+void          ide_widget_add_style_class     (GtkWidget               *widget,
+                                              const gchar             *class_name);
 IdeWorkbench *ide_widget_get_workbench       (GtkWidget               *widget);
 gpointer      ide_widget_find_child_typed    (GtkWidget               *widget,
                                               GType                    type);


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