forked from AuroraMiddleware/gtk
fishbowl: Remove visibility handling
First, almost all widgets are either visible and mapped, or visible and unmapped because they are !child_visible. In both cases, we do care about the size. If they are indeed invisible, gtk_widget_measure() will take care of that by returning all 0. And gtk_widget_unparent() already queues a resize on the parent if necessary, so that is unneeded as well.
This commit is contained in:
parent
9eaeb04863
commit
5eb181281a
@ -108,10 +108,6 @@ gtk_fishbowl_measure (GtkWidget *widget,
|
||||
{
|
||||
child = value;
|
||||
|
||||
if (!gtk_widget_get_visible (child->widget))
|
||||
continue;
|
||||
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_widget_measure (child->widget, orientation, -1, &child_min, &child_nat, NULL, NULL);
|
||||
@ -148,9 +144,6 @@ gtk_fishbowl_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
child = value;
|
||||
|
||||
if (!gtk_widget_get_visible (child->widget))
|
||||
continue;
|
||||
|
||||
gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
|
||||
child_allocation.x = round (child->x * (width - child_requisition.width));
|
||||
child_allocation.y = round (child->y * (height - child_requisition.height));
|
||||
@ -197,17 +190,11 @@ gtk_fishbowl_remove (GtkFishbowl *fishbowl,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
|
||||
GtkWidget *widget_bowl = GTK_WIDGET (fishbowl);
|
||||
|
||||
if (g_hash_table_remove (priv->children, widget))
|
||||
{
|
||||
gboolean was_visible = gtk_widget_get_visible (widget);
|
||||
|
||||
gtk_widget_unparent (widget);
|
||||
|
||||
if (was_visible && gtk_widget_get_visible (widget_bowl))
|
||||
gtk_widget_queue_resize (widget_bowl);
|
||||
|
||||
priv->count--;
|
||||
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_COUNT]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user