Revision: 1728
http://geeqie.svn.sourceforge.net/geeqie/?rev=1728&view=rev
Author: nadvornik
Date: 2009-06-06 11:15:09 +0000 (Sat, 06 Jun 2009)
Log Message:
-----------
reduced jumping of directory tree when user clicks on folders
Modified Paths:
--------------
trunk/src/view_dir_tree.c
Modified: trunk/src/view_dir_tree.c
===================================================================
--- trunk/src/view_dir_tree.c 2009-06-05 21:52:37 UTC (rev 1727)
+++ trunk/src/view_dir_tree.c 2009-06-06 11:15:09 UTC (rev 1728)
@@ -694,13 +694,10 @@
if (vd_find_row(vd, fd, &iter))
{
GtkTreeModel *store;
- GtkTreePath *tpath;
+ GtkTreePath *tpath, *old_tpath;
GtkTreeSelection *selection;
store = gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view));
- tpath = gtk_tree_model_get_path(store, &iter);
- gtk_tree_view_set_cursor(GTK_TREE_VIEW(vd->view), tpath, NULL,
FALSE);
- gtk_tree_path_free(tpath);
selection =
gtk_tree_view_get_selection(GTK_TREE_VIEW(vd->view));
@@ -709,7 +706,16 @@
gtk_tree_selection_select_iter(selection, &iter);
selection_is_ok = FALSE;
- tree_view_row_make_visible(GTK_TREE_VIEW(vd->view), &iter,
TRUE);
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(vd->view), &old_tpath,
NULL);
+ tpath = gtk_tree_model_get_path(store, &iter);
+
+ if (!old_tpath || gtk_tree_path_compare(tpath, old_tpath) != 0)
+ {
+ /* setting the cursor scrolls the view; do not do that
unless it is necessary */
+ gtk_tree_view_set_cursor(GTK_TREE_VIEW(vd->view),
tpath, NULL, FALSE);
+ }
+ gtk_tree_path_free(tpath);
+ gtk_tree_path_free(old_tpath);
}
return TRUE;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn