Branch: refs/heads/master Author: Steven Blatnick sblatnick@proofpoint.com Committer: Steven Blatnick sblatnick@proofpoint.com Date: Mon, 17 Dec 2012 22:41:03 UTC Commit: 04bf45f28c9bcffccdebdd9d7f6062e245296d11 https://github.com/geany/geany-plugins/commit/04bf45f28c9bcffccdebdd9d7f6062...
Log Message: ----------- Treebrowser expand/collapse 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).