diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-06-18 13:13:30 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2014-06-18 13:13:30 +0200 |
commit | 30e07a1f3df53d84e72440bde1a1bdef6db5e5d2 (patch) | |
tree | e8f3f4eb5322749eb065a32d1c0689288ae8f212 | |
parent | ec68c85c52576b8d76541d2040648180a6aa7382 (diff) | |
download | gtk+-30e07a1f3df53d84e72440bde1a1bdef6db5e5d2.tar.gz |
gtkpopover: set background and popover css classes
-rw-r--r-- | gtk/gtkpopover.c | 5 | ||||
-rw-r--r-- | gtk/gtkstylecontext.h | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 6255e0e5a5..6f6f3f07c1 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -119,12 +119,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 1bab4394d6..96033b1b84 100644 --- a/gtk/gtkstylecontext.h +++ b/gtk/gtkstylecontext.h @@ -786,6 +786,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 */ /** |