gtkpopover: set background and popover css classes

https://bugzilla.gnome.org/show_bug.cgi?id=731834
This commit is contained in:
Lars Uebernickel 2014-06-18 13:13:30 +02:00
parent c2b7ebff11
commit d0a3c8bd6f
2 changed files with 14 additions and 0 deletions

View File

@ -153,12 +153,17 @@ static void
gtk_popover_init (GtkPopover *popover) gtk_popover_init (GtkPopover *popover)
{ {
GtkWidget *widget; GtkWidget *widget;
GtkStyleContext *context;
widget = GTK_WIDGET (popover); widget = GTK_WIDGET (popover);
gtk_widget_set_has_window (widget, TRUE); gtk_widget_set_has_window (widget, TRUE);
popover->priv = gtk_popover_get_instance_private (popover); popover->priv = gtk_popover_get_instance_private (popover);
popover->priv->modal = TRUE; popover->priv->modal = TRUE;
popover->priv->apply_shape = 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 static void

View File

@ -796,6 +796,15 @@ struct _GtkStyleContextClass
*/ */
#define GTK_STYLE_CLASS_DESTRUCTIVE_ACTION "destructive-action" #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 */ /* Predefined set of widget regions */
/** /**