mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 22:20:24 +00:00
Merge branch 'popover-critical-fix' into 'main'
popover: Take shadow size into account in measure Closes #5782 and #6796 See merge request GNOME/gtk!7403
This commit is contained in:
commit
a8bfe4e6f2
@ -1511,12 +1511,20 @@ gtk_popover_measure (GtkWidget *widget,
|
||||
GtkCssStyle *style;
|
||||
GtkBorder shadow_width;
|
||||
|
||||
if (for_size >= 0 && (POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL)))
|
||||
for_size -= tail_height;
|
||||
|
||||
style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (priv->contents_widget)));
|
||||
gtk_css_shadow_value_get_extents (style->used->box_shadow, &shadow_width);
|
||||
|
||||
if (for_size >= 0)
|
||||
{
|
||||
if ((POS_IS_VERTICAL (priv->position) == (orientation == GTK_ORIENTATION_HORIZONTAL)))
|
||||
for_size -= tail_height;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
for_size -= shadow_width.top + shadow_width.bottom;
|
||||
else
|
||||
for_size -= shadow_width.left + shadow_width.right;
|
||||
}
|
||||
|
||||
gtk_widget_measure (priv->contents_widget,
|
||||
orientation, for_size,
|
||||
minimum, natural,
|
||||
|
Loading…
Reference in New Issue
Block a user