[gtk+] treeview: Update adjustment usage for sealing



commit 6ff585e18951e27cea2883e59aa0d0e3cc41d55e
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jan 5 13:58:28 2011 +0100

    treeview: Update adjustment usage for sealing
    
    Use gtk_adjustment_set_upper() instead of doing its work manually.

 gtk/gtktreeview.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 4a715e8..5d91878 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -6572,10 +6572,10 @@ validate_visible_area (GtkTreeView *tree_view)
 
       gtk_widget_get_preferred_size (GTK_WIDGET (tree_view),
                                      &requisition, NULL);
-      tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
-      tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
-      gtk_adjustment_changed (tree_view->priv->hadjustment);
-      gtk_adjustment_changed (tree_view->priv->vadjustment);
+      gtk_adjustment_set_upper (tree_view->priv->hadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width));
+      gtk_adjustment_set_upper (tree_view->priv->vadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height));
       gtk_widget_queue_resize (GTK_WIDGET (tree_view));
     }
 
@@ -6772,10 +6772,10 @@ do_validate_rows (GtkTreeView *tree_view, gboolean queue_resize)
        */
       gtk_tree_view_size_request (GTK_WIDGET (tree_view), &requisition, FALSE);
 
-      tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
-      tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
-      gtk_adjustment_changed (tree_view->priv->hadjustment);
-      gtk_adjustment_changed (tree_view->priv->vadjustment);
+      gtk_adjustment_set_upper (tree_view->priv->hadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width));
+      gtk_adjustment_set_upper (tree_view->priv->vadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height));
 
       if (queue_resize)
         gtk_widget_queue_resize (GTK_WIDGET (tree_view));
@@ -6837,10 +6837,10 @@ do_presize_handler (GtkTreeView *tree_view)
       gtk_widget_get_preferred_size (GTK_WIDGET (tree_view),
                                      &requisition, NULL);
 
-      tree_view->priv->hadjustment->upper = MAX (tree_view->priv->hadjustment->upper, (gfloat)requisition.width);
-      tree_view->priv->vadjustment->upper = MAX (tree_view->priv->vadjustment->upper, (gfloat)requisition.height);
-      gtk_adjustment_changed (tree_view->priv->hadjustment);
-      gtk_adjustment_changed (tree_view->priv->vadjustment);
+      gtk_adjustment_set_upper (tree_view->priv->hadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->hadjustment), requisition.width));
+      gtk_adjustment_set_upper (tree_view->priv->vadjustment,
+                                MAX (gtk_adjustment_get_upper (tree_view->priv->vadjustment), requisition.height));
       gtk_widget_queue_resize (GTK_WIDGET (tree_view));
     }
 		   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]