From bf6ffda86a0ae6813f32e2b9e1084dd1c4761828 Mon Sep 17 00:00:00 2001 From: ader Date: Thu, 1 May 2014 20:46:27 -0400 Subject: added "open search in new tab" (using C-Enter on search) per https://github.com/conformal/xombrero/issues/61 --- settings.c | 1 + xombrero.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/settings.c b/settings.c index 8b1fbc9..9267d69 100644 --- a/settings.c +++ b/settings.c @@ -1486,6 +1486,7 @@ struct key_binding keys[] = { { "editelement", CTRL, 1, GDK_i }, { "passthrough", CTRL, 1, GDK_z }, { "modurl", CTRL, 1, GDK_Return }, + { "modsearchentry", CTRL, 1, GDK_Return }, { "urlmod plus", MOD1, 1, GDK_a }, { "urlmod min", MOD1, 1, GDK_A }, diff --git a/xombrero.c b/xombrero.c index ca5a471..9904abc 100644 --- a/xombrero.c +++ b/xombrero.c @@ -251,6 +251,7 @@ int next_download_id = 1; void xxx_dir(char *); int icon_size_map(int); void activate_uri_entry_cb(GtkWidget*, struct tab *); +void activate_search_entry_cb(GtkWidget*, struct tab *); void history_delete(struct command_list *l, int *counter) @@ -1164,6 +1165,25 @@ modurl(struct tab *t, struct karg *args) return (0); } +int +modsearchentry(struct tab *t, struct karg *args) +{ + const gchar *s = NULL; + struct tab *tt; + + /* XXX kind of a bad hack (in honor of the modurl hack) */ + if (gtk_widget_has_focus(t->search_entry)) { + if ((s = gtk_entry_get_text(GTK_ENTRY(t->search_entry))) && + (strlen(s))) { + tt = create_new_tab(NULL, NULL, 1, -1); + gtk_entry_set_text(GTK_ENTRY(tt->search_entry), s); + activate_search_entry_cb(t->search_entry,tt); + gtk_entry_set_text(GTK_ENTRY(t->search_entry), ""); + } + } + return (0); +} + int hint(struct tab *t, struct karg *args) { @@ -3248,6 +3268,7 @@ struct cmd { { "editelement", 0, edit_element, 0, 0 }, { "passthrough", 0, passthrough, 0, 0 }, { "modurl", 0, modurl, 0, 0 }, + { "modsearchentry", 0, modsearchentry, 0, 0 }, /* yanking and pasting */ { "yankuri", 0, yank_uri, 0, 0 }, -- cgit 1.4.1-2-gfad0 ption value='committer'>committer
path: root/valentine/yes.html
blob: 955ba0ae341e95dfad4817c77151bb2d639966a6 (plain) (tree)