mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
popover: Handle shadow changes
When the box-shadow css property of the contents widget changes, queue a resize on the popover.
This commit is contained in:
parent
39f72b3834
commit
aa1d08687d
@ -879,6 +879,15 @@ node_style_changed_cb (GtkCssNode *node,
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
contents_css_changed (GtkGizmo *contents,
|
||||
GtkCssStyleChange *change)
|
||||
{
|
||||
if (change == NULL ||
|
||||
gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_BOX_SHADOW))
|
||||
gtk_widget_queue_resize (gtk_widget_get_parent (GTK_WIDGET (contents)));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_popover_init (GtkPopover *popover)
|
||||
{
|
||||
@ -914,6 +923,7 @@ gtk_popover_init (GtkPopover *popover)
|
||||
priv->contents_widget = gtk_gizmo_new ("contents", NULL, NULL, NULL, NULL,
|
||||
(GtkGizmoFocusFunc)gtk_widget_focus_child,
|
||||
(GtkGizmoGrabFocusFunc)gtk_widget_grab_focus_child);
|
||||
gtk_gizmo_set_css_changed_func (GTK_GIZMO (priv->contents_widget), contents_css_changed);
|
||||
gtk_widget_set_layout_manager (priv->contents_widget, gtk_bin_layout_new ());
|
||||
gtk_widget_set_parent (priv->contents_widget, GTK_WIDGET (popover));
|
||||
gtk_widget_set_overflow (priv->contents_widget, GTK_OVERFLOW_HIDDEN);
|
||||
|
Loading…
Reference in New Issue
Block a user