From c16f33a0183bf8da7c13eea9f85472d1ef807be0 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Sat, 12 Jul 2003 16:26:19 +0000 Subject: A "fast search" implementation for all node views. Pressing any valid A "fast search" implementation for all node views. Pressing any valid unicode character will make ephy select the first entry begining with that key, or the nearest match (with previous or posterior letters). Fixes bug #116744 (http://bugzilla.gnome.org/show_bug.cgi?id=116744). --- src/bookmarks/ephy-bookmarks-editor.c | 15 ++++++--------- src/ephy-history-window.c | 6 ++++-- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c index 789239ad7..d7a8b0939 100644 --- a/src/bookmarks/ephy-bookmarks-editor.c +++ b/src/bookmarks/ephy-bookmarks-editor.c @@ -1011,16 +1011,11 @@ key_pressed_cb (EphyNodeView *view, GdkEventKey *event, EphyBookmarksEditor *editor) { - switch (event->keyval) + if (event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete) { - case GDK_Delete: - case GDK_KP_Delete: cmd_delete (NULL, editor); return TRUE; - - default: - break; - } + } return FALSE; } @@ -1280,7 +1275,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) EPHY_NODE_KEYWORD_PROP_NAME, EPHY_NODE_KEYWORD_PROP_PRIORITY, EPHY_NODE_VIEW_AUTO_SORT | - EPHY_NODE_VIEW_EDITABLE, NULL); + EPHY_NODE_VIEW_EDITABLE | + EPHY_NODE_VIEW_SEARCHABLE, NULL); gtk_container_add (GTK_CONTAINER (scrolled_window), key_view); gtk_widget_set_size_request (key_view, 130, -1); gtk_widget_show (key_view); @@ -1334,7 +1330,8 @@ ephy_bookmarks_editor_construct (EphyBookmarksEditor *editor) ephy_node_view_add_column (EPHY_NODE_VIEW (bm_view), _("Title"), G_TYPE_STRING, EPHY_NODE_BMK_PROP_TITLE, -1, EPHY_NODE_VIEW_AUTO_SORT | - EPHY_NODE_VIEW_EDITABLE, + EPHY_NODE_VIEW_EDITABLE | + EPHY_NODE_VIEW_SEARCHABLE, provide_favicon); gtk_container_add (GTK_CONTAINER (scrolled_window), bm_view); gtk_widget_show (bm_view); diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index 060cde755..8636557c9 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -1025,7 +1025,8 @@ ephy_history_window_construct (EphyHistoryWindow *editor) G_TYPE_STRING, EPHY_NODE_PAGE_PROP_TITLE, EPHY_NODE_PAGE_PROP_PRIORITY, - EPHY_NODE_VIEW_AUTO_SORT, + EPHY_NODE_VIEW_AUTO_SORT | + EPHY_NODE_VIEW_SEARCHABLE, provide_favicon); gtk_container_add (GTK_CONTAINER (scrolled_window), sites_view); gtk_widget_show (sites_view); @@ -1069,7 +1070,8 @@ ephy_history_window_construct (EphyHistoryWindow *editor) EPHY_NODE_PAGE_PROP_LOCATION); col = ephy_node_view_add_column (EPHY_NODE_VIEW (pages_view), _("Title"), G_TYPE_STRING, EPHY_NODE_PAGE_PROP_TITLE, - -1, EPHY_NODE_VIEW_USER_SORT, NULL); + -1, EPHY_NODE_VIEW_USER_SORT | + EPHY_NODE_VIEW_SEARCHABLE, NULL); gtk_tree_view_column_set_max_width (col, 250); col = ephy_node_view_add_column (EPHY_NODE_VIEW (pages_view), _("Address"), G_TYPE_STRING, EPHY_NODE_PAGE_PROP_LOCATION, -- cgit v1.2.3