diff options
author | Benjamin Berg <bberg@redhat.com> | 2021-01-15 15:12:35 +0100 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2021-01-15 15:12:35 +0100 |
commit | 56d2b69e912d3c7c07f8793b38db874ae1727619 (patch) | |
tree | 2f94f72e1001b54b3c0855ed5db461cd02c47a65 | |
parent | 955e0412495efd1c15be7336e77c40bbc265f8c9 (diff) | |
download | epiphany-benzea/select-pre-filled-search-text.tar.gz |
find-toolbar: Select pre-filled text in search fieldbenzea/select-pre-filled-search-text
With commit 809d76e6cfc7 (Pre-fill search field with current selected
text) focused text from the website will be pre-filled into the search
entry. This is great, but even though the entry is focused, one cannot
simply start typing to update the search text.
Improve this user interaction by selecting the pre-filled text.
Related: #809
-rw-r--r-- | embed/ephy-find-toolbar.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c index 34b3d90d9..ff640b28b 100644 --- a/embed/ephy-find-toolbar.c +++ b/embed/ephy-find-toolbar.c @@ -645,10 +645,12 @@ ephy_find_toolbar_selection_async (GObject *source_object, str_value = jsc_value_to_string (value); exception = jsc_context_get_exception (jsc_value_get_context (value)); - if (exception) + if (exception) { g_warning ("Error running javascript: %s", jsc_exception_get_message (exception)); - else if (strlen (str_value)) + } else if (strlen (str_value)) { gtk_entry_set_text (GTK_ENTRY (toolbar->entry), str_value); + gtk_editable_select_region (GTK_EDITABLE (toolbar->entry), 0, -1); + } } } |