Branch: refs/heads/master Author: Frank Lanitz frank@frank.uvena.de Committer: Frank Lanitz frank@frank.uvena.de Date: Mon, 24 Dec 2012 12:53:18 UTC Commit: d88bbeaaa3d5acae8eb4924110f2bf443b8615ed https://github.com/geany/geany-plugins/commit/d88bbeaaa3d5acae8eb4924110f2bf...
Log Message: ----------- Merge pull request #76 from sblatnick/master
Treebrowser expand/collapse folders with spacebar
Modified Paths: -------------- treebrowser/src/treebrowser.c
Modified: treebrowser/src/treebrowser.c 18 files changed, 17 insertions(+), 1 deletions(-) =================================================================== @@ -1422,6 +1422,22 @@ enum static gboolean on_treeview_keypress(GtkWidget *widget, GdkEventKey *event) { + if (event->keyval == GDK_space) + { + GtkTreeIter iter; + GtkTreeModel *model; + GtkTreePath *path; + + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widget)), &model, &iter)) + { + path = gtk_tree_model_get_path(model, &iter); + if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path)) + gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path); + else + gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path, FALSE); + return TRUE; + } + } if (event->keyval == GDK_BackSpace) { on_button_go_up(); @@ -1734,7 +1750,7 @@ enum g_signal_connect(treeview, "row-activated", G_CALLBACK(on_treeview_row_activated), NULL); g_signal_connect(treeview, "row-collapsed", G_CALLBACK(on_treeview_row_collapsed), NULL); g_signal_connect(treeview, "row-expanded", G_CALLBACK(on_treeview_row_expanded), NULL); - g_signal_connect(treeview, "key-release-event", G_CALLBACK(on_treeview_keypress), NULL); + g_signal_connect(treeview, "key-press-event", G_CALLBACK(on_treeview_keypress), NULL); g_signal_connect(addressbar, "activate", G_CALLBACK(on_addressbar_activate), NULL); g_signal_connect(filter, "activate", G_CALLBACK(on_filter_activate), NULL);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).
plugins-commits@lists.geany.org