summaryrefslogtreecommitdiff
path: root/gtk/gtk_scaffolding.c
diff options
context:
space:
mode:
authorRob Kendrick <rjek@netsurf-browser.org>2009-02-28 20:02:09 +0000
committerRob Kendrick <rjek@netsurf-browser.org>2009-02-28 20:02:09 +0000
commit5b53bb6baaa6128b304e54e9f16e52ab6073787f (patch)
tree0eaf075169746b3bf764fe77a43296c67babe168 /gtk/gtk_scaffolding.c
parent460460b493673f0a235ca41162b14b5b31e62273 (diff)
downloadnetsurf-5b53bb6baaa6128b304e54e9f16e52ab6073787f.tar.gz
netsurf-5b53bb6baaa6128b304e54e9f16e52ab6073787f.tar.bz2
Select the text in the URL bar on Ctrl-A if the widget has the focus, rather
than the document text. Thanks to PaweĊ‚ Blokus <pblokus@gmail.com> for the patch. svn path=/trunk/netsurf/; revision=6659
Diffstat (limited to 'gtk/gtk_scaffolding.c')
-rw-r--r--gtk/gtk_scaffolding.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtk_scaffolding.c b/gtk/gtk_scaffolding.c
index 9d44112f8..8e687184c 100644
--- a/gtk/gtk_scaffolding.c
+++ b/gtk/gtk_scaffolding.c
@@ -777,9 +777,14 @@ MENUHANDLER(select_all)
struct gtk_scaffolding *gw = (struct gtk_scaffolding *)g;
struct browser_window *bw = nsgtk_get_browser_for_gui(gw->top_level);
- LOG(("Selecting all text"));
- selection_select_all(bw->sel);
-
+ if (GTK_WIDGET_HAS_FOCUS(gw->url_bar)) {
+ LOG(("Selecting all URL bar text"));
+ gtk_editable_select_region(GTK_EDITABLE(gw->url_bar), 0, -1);
+ } else {
+ LOG(("Selecting all document text"));
+ selection_select_all(bw->sel);
+ }
+
return TRUE;
}