diff options
author | Benjamin Otte <otte@redhat.com> | 2019-03-12 01:41:21 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-03-19 08:48:41 +0100 |
commit | 96a677e5ca1bce8ce8178d300100cc8553d14bac (patch) | |
tree | e287005eadfca6064db1e7d625c80348c977c912 /gtk/gtkpaned.c | |
parent | 07054ca20d7ad7e82fdb723659e478478c9b2fee (diff) | |
download | gtk+-96a677e5ca1bce8ce8178d300100cc8553d14bac.tar.gz |
paned: Refactor
Don't call a useless function, call gtk_widget_set_child_visible()
directly.
Diffstat (limited to 'gtk/gtkpaned.c')
-rw-r--r-- | gtk/gtkpaned.c | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index cc20a759ba..ba97855c7e 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -1182,22 +1182,6 @@ flip_child (int width, } static void -gtk_paned_set_child_visible (GtkPaned *paned, - guint id, - gboolean visible) -{ - GtkPanedPrivate *priv = gtk_paned_get_instance_private (paned); - GtkWidget *child; - - child = id == CHILD1 ? priv->child1 : priv->child2; - - if (child == NULL) - return; - - gtk_widget_set_child_visible (child, visible); -} - -static void gtk_paned_size_allocate (GtkWidget *widget, int width, int height, @@ -1321,26 +1305,19 @@ gtk_paned_size_allocate (GtkWidget *widget, { if (priv->child1 && gtk_widget_get_visible (priv->child1)) { - gtk_paned_set_child_visible (paned, CHILD1, TRUE); - gtk_paned_set_child_visible (paned, CHILD2, FALSE); + gtk_widget_set_child_visible (priv->child1, TRUE); gtk_widget_size_allocate (priv->child1, &(GtkAllocation) {0, 0, width, height}, -1); } else if (priv->child2 && gtk_widget_get_visible (priv->child2)) { - gtk_paned_set_child_visible (paned, CHILD1, FALSE); - gtk_paned_set_child_visible (paned, CHILD2, TRUE); + gtk_widget_set_child_visible (priv->child2, TRUE); gtk_widget_size_allocate (priv->child2, &(GtkAllocation) {0, 0, width, height}, -1); } - else - { - gtk_paned_set_child_visible (paned, CHILD1, FALSE); - gtk_paned_set_child_visible (paned, CHILD2, FALSE); - } } } @@ -1810,8 +1787,8 @@ gtk_paned_calc_position (GtkPaned *paned, &priv->min_position, &priv->max_position, &priv->child1_size); - gtk_paned_set_child_visible (paned, CHILD1, priv->child1_size != 0); - gtk_paned_set_child_visible (paned, CHILD2, priv->child1_size != allocation); + gtk_widget_set_child_visible (priv->child1, priv->child1_size != 0); + gtk_widget_set_child_visible (priv->child2, priv->child1_size != allocation); g_object_freeze_notify (G_OBJECT (paned)); if (priv->child1_size != old_position) |