aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-topics-selector.c
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-03-29 00:06:33 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-03-29 00:06:33 +0800
commitd15bb064a753c1087301d830f6ebf036290f26d7 (patch)
treee4695096c31aa1ec7581af362a2997876ac45f6c /src/bookmarks/ephy-topics-selector.c
parent7f45e7613d25995f69daf640bebc05399b557f91 (diff)
downloadgsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar.gz
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar.bz2
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar.lz
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar.xz
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.tar.zst
gsoc2013-epiphany-d15bb064a753c1087301d830f6ebf036290f26d7.zip
Use the same key_press callback for both the topics and bm's view.
2003-03-27 David Bordoley <bordoley@msu.edu> * src/bookmarks/ephy-bookmarks-editor.c: (key_pressed_cb), (ephy_bookmarks_editor_construct): Use the same key_press callback for both the topics and bm's view. s/bookmarks/title in the bm tree. Remove an unused enum. * src/bookmarks/ephy-topics-selector.c: (topic_key_pressed), (ephy_topics_build_ui): Use space, return and enter to toggle topics in the selector.
Diffstat (limited to 'src/bookmarks/ephy-topics-selector.c')
-rw-r--r--src/bookmarks/ephy-topics-selector.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-topics-selector.c b/src/bookmarks/ephy-topics-selector.c
index 97023550c..40f6a89b6 100644
--- a/src/bookmarks/ephy-topics-selector.c
+++ b/src/bookmarks/ephy-topics-selector.c
@@ -330,6 +330,39 @@ topic_clicked (GtkTreeView *tree_view,
return FALSE;
}
+static gboolean
+topic_key_pressed (GtkTreeView *tree_view,
+ GdkEventKey *event,
+ EphyTopicsSelector *selector)
+{
+ GtkTreeSelection *sel = NULL;
+ GtkTreeIter iter;
+ GtkTreePath *path = NULL;
+ gchar *path_str;
+
+ switch (event->keyval)
+ {
+ case GDK_space:
+ case GDK_Return:
+ case GDK_KP_Enter:
+ sel = gtk_tree_view_get_selection (tree_view);
+
+ if (gtk_tree_selection_get_selected (sel, NULL, &iter))
+ {
+ path = gtk_tree_model_get_path (selector->priv->model, &iter);
+ path_str = gtk_tree_path_to_string (path);
+ topic_toggled (NULL, path_str, selector);
+ g_free(path_str);
+ }
+ return TRUE;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
static void
ephy_topics_build_ui (EphyTopicsSelector *editor)
{
@@ -358,6 +391,8 @@ ephy_topics_build_ui (EphyTopicsSelector *editor)
("Description", renderer, "text", COL_TOPIC, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
+ g_signal_connect (G_OBJECT (treeview), "key_press_event",
+ G_CALLBACK (topic_key_pressed), editor);
g_signal_connect (G_OBJECT (treeview), "button_press_event",
G_CALLBACK (topic_clicked), editor);
fill_model (editor);