[gtk+] popover: Add the .background style class



commit eade244cacb79410314513b5cf105b910ac2fd90
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Nov 4 12:01:26 2015 -0500

    popover: Add the .background style class
    
    This style class indicates that something _requires_ a background,
    which is clearly the case for popovers.

 gtk/gtkpopover.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 8ead636..7050e68 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -73,9 +73,9 @@
  *
  * # CSS nodes
  *
- * GtkPopover has a single css node called popover and gets the
- * .menu style class if it is menu-like (e.g. #GtkPopoverMenu or
- * created using gtk_popover_new_from_model().
+ * GtkPopover has a single css node called popover It always gets the
+ * .background style class and it gets the .menu style class if it is
+ * menu-like (e.g. #GtkPopoverMenu or created using gtk_popover_new_from_model().
  *
  * Particular uses of GtkPopover, such as touch selection popups
  * or magnifiers in #GtkEntry or #GtkTextView get style classes
@@ -191,6 +191,7 @@ static void
 gtk_popover_init (GtkPopover *popover)
 {
   GtkWidget *widget;
+  GtkStyleContext *context;
 
   widget = GTK_WIDGET (popover);
   gtk_widget_set_has_window (widget, TRUE);
@@ -198,6 +199,9 @@ gtk_popover_init (GtkPopover *popover)
   popover->priv->modal = TRUE;
   popover->priv->tick_id = 0;
   popover->priv->transitions_enabled = TRUE;
+
+  context = gtk_widget_get_style_context (GTK_WIDGET (popover));
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND);
 }
 
 static void


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