forked from AuroraMiddleware/gtk
Merge branch 'revealer-clipping' into 'master'
revealer: Only clip child when animating See merge request GNOME/gtk!301
This commit is contained in:
commit
a6c47cb3ab
@ -617,20 +617,20 @@ gtk_revealer_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkRevealer *revealer = GTK_REVEALER (widget);
|
||||
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
|
||||
GtkRevealerTransitionType transition;
|
||||
GtkWidget *child;
|
||||
gboolean clip_child;
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (revealer));
|
||||
if (child == NULL || !gtk_widget_get_mapped (child))
|
||||
return;
|
||||
|
||||
transition = effective_transition (revealer);
|
||||
if (transition == GTK_REVEALER_TRANSITION_TYPE_NONE ||
|
||||
transition == GTK_REVEALER_TRANSITION_TYPE_CROSSFADE)
|
||||
{
|
||||
gtk_widget_snapshot_child (widget, child, snapshot);
|
||||
}
|
||||
else
|
||||
clip_child = transition != GTK_REVEALER_TRANSITION_TYPE_NONE &&
|
||||
transition != GTK_REVEALER_TRANSITION_TYPE_CROSSFADE &&
|
||||
gtk_progress_tracker_get_state (&priv->tracker) != GTK_PROGRESS_STATE_AFTER;
|
||||
if (clip_child)
|
||||
{
|
||||
gtk_snapshot_push_clip (snapshot,
|
||||
&GRAPHENE_RECT_INIT(
|
||||
@ -641,6 +641,8 @@ gtk_revealer_snapshot (GtkWidget *widget,
|
||||
gtk_widget_snapshot_child (widget, child, snapshot);
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
else
|
||||
gtk_widget_snapshot_child (widget, child, snapshot);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user