[gthumb/ext] expand or collapse a folder with a double-click



commit debeaef89caff1931f643475de578e1d1f6c0286
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Sep 24 23:36:46 2009 +0200

    expand or collapse a folder with a double-click
    
    [bug #594883]

 gthumb/gth-folder-tree.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-folder-tree.c b/gthumb/gth-folder-tree.c
index 5b69c77..3568663 100644
--- a/gthumb/gth-folder-tree.c
+++ b/gthumb/gth-folder-tree.c
@@ -470,7 +470,10 @@ button_press_cb (GtkWidget      *widget,
 		folder_tree->priv->click_path = gtk_tree_path_copy (path);
 	}
 	else if ((event->button == 1) && (event->type == GDK_2BUTTON_PRESS)) {
-		gtk_tree_view_row_activated (GTK_TREE_VIEW (folder_tree), path, NULL);
+		if (! gtk_tree_view_row_expanded (GTK_TREE_VIEW (folder_tree), path))
+			gtk_tree_view_expand_row (GTK_TREE_VIEW (folder_tree), path, FALSE);
+		else
+			gtk_tree_view_collapse_row (GTK_TREE_VIEW (folder_tree), path);
 		retval = TRUE;
 	}
 



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