[gtk/popup-shadow-width: 75/78] popover: Handle shadow changes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/popup-shadow-width: 75/78] popover: Handle shadow changes
- Date: Sun, 14 Feb 2021 02:13:22 +0000 (UTC)
commit 09209c5a56cf9140eed2a1cf6a1318a660fc3566
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Feb 13 19:05:26 2021 -0500
popover: Handle shadow changes
When the box-shadow css property of the contents
widget changes, queue a resize on the popover.
gtk/gtkpopover.c | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 217c2f30a2..bf9be24709 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]