aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-03-06 01:33:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-03-06 01:34:28 +0800
commitc6fd77460f5baf88528f5da2ffb99e86a2885ff0 (patch)
tree377ddb36bc9c907a06d5889123582b2066db42a8 /mail/em-folder-tree.c
parent29d8b02c557a65aec4b015b274a830b402da2cfd (diff)
downloadgsoc2013-evolution-c6fd77460f5baf88528f5da2ffb99e86a2885ff0.tar.gz
gsoc2013-evolution-c6fd77460f5baf88528f5da2ffb99e86a2885ff0.tar.zst
gsoc2013-evolution-c6fd77460f5baf88528f5da2ffb99e86a2885ff0.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index ee853331bf..81803b53a3 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1453,7 +1453,8 @@ folder_tree_init (EMFolderTree *folder_tree)
select_uris_table = g_hash_table_new (g_str_hash, g_str_equal);
- folder_tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (folder_tree, EM_TYPE_FOLDER_TREE, EMFolderTreePrivate);
+ folder_tree->priv = G_TYPE_INSTANCE_GET_PRIVATE (
+ folder_tree, EM_TYPE_FOLDER_TREE, EMFolderTreePrivate);
folder_tree->priv->select_uris_table = select_uris_table;
tree_view = GTK_TREE_VIEW (folder_tree);
@@ -2423,28 +2424,33 @@ tree_autoscroll (EMFolderTree *folder_tree)
GtkTreeView *tree_view;
GdkRectangle rect;
GdkWindow *window;
+ gdouble value;
gint offset, y;
- /* get the y pointer position relative to the treeview */
+ /* Get the y pointer position relative to the treeview. */
tree_view = GTK_TREE_VIEW (folder_tree);
window = gtk_tree_view_get_bin_window (tree_view);
gdk_window_get_pointer (window, NULL, &y, NULL);
- /* rect is in coorinates relative to the scrolled window relative to the treeview */
+ /* Rect is in coorinates relative to the scrolled window,
+ * relative to the treeview. */
gtk_tree_view_get_visible_rect (tree_view, &rect);
- /* move y into the same coordinate system as rect */
+ /* Move y into the same coordinate system as rect. */
y += rect.y;
- /* see if we are near the top edge */
- if ((offset = y - (rect.y + 2 * SCROLL_EDGE_SIZE)) > 0) {
- /* see if we are near the bottom edge */
- if ((offset = y - (rect.y + rect.height - 2 * SCROLL_EDGE_SIZE)) < 0)
+ /* See if we are near the top edge. */
+ offset = y - (rect.y + 2 * SCROLL_EDGE_SIZE);
+ if (offset > 0) {
+ /* See if we are near the bottom edge. */
+ offset = y - (rect.y + rect.height - 2 * SCROLL_EDGE_SIZE);
+ if (offset < 0)
return TRUE;
}
adjustment = gtk_tree_view_get_vadjustment (tree_view);
- gtk_adjustment_set_value (adjustment, MAX (gtk_adjustment_get_value (adjustment) + offset, 0.0));
+ value = gtk_adjustment_get_value (adjustment);
+ gtk_adjustment_set_value (adjustment, MAX (value + offset, 0.0));
return TRUE;
}