diff options
author | Jean-François Rameau <jframeau@cvs.gnome.org> | 2006-09-14 05:11:34 +0800 |
---|---|---|
committer | Jean-François Rameau <jframeau@src.gnome.org> | 2006-09-14 05:11:34 +0800 |
commit | 08d1d04c64f852b15b07626b8614a60999580828 (patch) | |
tree | 5e88068ec120777cf0f4cd296b47374422577283 /lib | |
parent | f6908fd270d6a74d6835b5a8cd0c2eb3b0863f74 (diff) | |
download | gsoc2013-epiphany-08d1d04c64f852b15b07626b8614a60999580828.tar.gz gsoc2013-epiphany-08d1d04c64f852b15b07626b8614a60999580828.tar.zst gsoc2013-epiphany-08d1d04c64f852b15b07626b8614a60999580828.zip |
Clicking favicon in the location bar selects URL. Fix bug #349557.
2006-09-13 Jean-François Rameau <jframeau@cvs.gnome.org>
* lib/widgets/ephy-location-entry.c: (ephy_location_entry_construct_contents),
(icon_button_press_event_cb):
Clicking favicon in the location bar selects URL. Fix bug #349557.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/widgets/ephy-location-entry.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index 6ccf8453b..963e4938d 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -832,6 +832,33 @@ favicon_drag_data_get_cb (GtkWidget *widget, } static gboolean +icon_button_press_event_cb (GtkWidget *ebox, + GdkEventButton *event, + EphyLocationEntry *entry) +{ + guint state = event->state & gtk_accelerator_get_default_mod_mask (); + + if (event->type == GDK_BUTTON_PRESS && + event->button == 1 && + state == 0 /* left */) + { + GtkWidget *toplevel; + EphyLocationEntryPrivate *priv = entry->priv; + + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (entry)); + gtk_window_set_focus (GTK_WINDOW(toplevel), + priv->icon_entry->entry); + + gtk_editable_select_region (GTK_EDITABLE (priv->icon_entry->entry), + 0, -1); + + return TRUE; + } + + return FALSE; +} + +static gboolean lock_button_press_event_cb (GtkWidget *ebox, GdkEventButton *event, EphyLocationEntry *entry) @@ -871,6 +898,8 @@ ephy_location_entry_construct_contents (EphyLocationEntry *entry) gtk_drag_source_set (priv->icon_ebox, GDK_BUTTON1_MASK, url_drag_types, G_N_ELEMENTS (url_drag_types), GDK_ACTION_ASK | GDK_ACTION_COPY | GDK_ACTION_LINK); + g_signal_connect (priv->icon_ebox, "button-press-event", + G_CALLBACK (icon_button_press_event_cb), entry); gtk_tooltips_set_tip (priv->tips, priv->icon_ebox, _("Drag and drop this icon to create a link to this page"), NULL); |