[epiphany/wip/dazzle: 6/10] location-entry: Implement suggestion-activated
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/dazzle: 6/10] location-entry: Implement suggestion-activated
- Date: Wed, 30 Aug 2017 01:46:31 +0000 (UTC)
commit 72483802e67b975a269bde1d0ca334764dcc336c
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Aug 27 19:46:51 2017 -0500
location-entry: Implement suggestion-activated
This makes the suggestions actually work
lib/widgets/ephy-location-entry.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index a3c843f..7142222 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -345,6 +345,17 @@ ephy_location_entry_cut_clipboard (GtkEntry *entry)
}
static void
+ephy_location_entry_suggestion_activated (DzlSuggestionEntry *entry,
+ DzlSuggestion *suggestion)
+{
+ /* The suggestion ID is the unescaped URL, which is what we need. */
+ gtk_entry_set_text (GTK_ENTRY (entry), dzl_suggestion_get_id (suggestion));
+
+ /* Now trigger the load.... */
+ g_signal_emit_by_name (entry, "activate");
+}
+
+static void
ephy_location_entry_title_widget_interface_init (EphyTitleWidgetInterface *iface)
{
iface->get_address = ephy_location_entry_title_widget_get_address;
@@ -359,6 +370,7 @@ ephy_location_entry_class_init (EphyLocationEntryClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkEntryClass *entry_class = GTK_ENTRY_CLASS (klass);
+ DzlSuggestionEntryClass *dzl_entry_class = DZL_SUGGESTION_ENTRY_CLASS (klass);
object_class->get_property = ephy_location_entry_get_property;
object_class->set_property = ephy_location_entry_set_property;
@@ -370,6 +382,8 @@ ephy_location_entry_class_init (EphyLocationEntryClass *klass)
entry_class->copy_clipboard = ephy_location_entry_copy_clipboard;
entry_class->cut_clipboard = ephy_location_entry_cut_clipboard;
+ dzl_entry_class->suggestion_activated = ephy_location_entry_suggestion_activated;
+
g_object_class_override_property (object_class, PROP_ADDRESS, "address");
g_object_class_override_property (object_class, PROP_SECURITY_LEVEL, "security-level");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]