[gtk+] gtkpopover: set background and popover css classes
- From: Lars Uebernickel <larsu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkpopover: set background and popover css classes
- Date: Wed, 18 Jun 2014 12:25:35 +0000 (UTC)
commit d0a3c8bd6f28f4deb57dc0b273473bafac84b172
Author: Lars Uebernickel <lars uebernickel canonical com>
Date: Wed Jun 18 13:13:30 2014 +0200
gtkpopover: set background and popover css classes
https://bugzilla.gnome.org/show_bug.cgi?id=731834
gtk/gtkpopover.c | 5 +++++
gtk/gtkstylecontext.h | 9 +++++++++
2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 089e8e9..b660a90 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -153,12 +153,17 @@ static void
gtk_popover_init (GtkPopover *popover)
{
GtkWidget *widget;
+ GtkStyleContext *context;
widget = GTK_WIDGET (popover);
gtk_widget_set_has_window (widget, TRUE);
popover->priv = gtk_popover_get_instance_private (popover);
popover->priv->modal = TRUE;
popover->priv->apply_shape = TRUE;
+
+ context = gtk_widget_get_style_context (widget);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_POPOVER);
}
static void
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index 6804616..4967d45 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -796,6 +796,15 @@ struct _GtkStyleContextClass
*/
#define GTK_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action"
+/**
+ * GTK_STYLE_CLASS_POPOVER:
+ *
+ * A CSS class that matches popovers. Used by #GtkPopover.
+ *
+ * Since: 3.14
+ */
+#define GTK_STYLE_CLASS_POPOVER "popover"
+
/* Predefined set of widget regions */
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]