From 1730a037daf5c370cc61bf8babd5c40fd816ef8a Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 13 May 2003 18:22:35 +0000 Subject: Revert api change. So we keep 2.2 compatibility. 2003-05-13 Marco Pesenti Gritti * embed/mozilla/ExternalProtocolService.cpp: Revert api change. So we keep 2.2 compatibility. * lib/widgets/ephy-location-entry.c: (ephy_location_entry_class_init), (location_focus_out_cb), (ephy_location_entry_activate_cb): * lib/widgets/ephy-location-entry.h: Add a finished callback to know when the user finished using location. * src/bookmarks/ephy-bookmarks.c: (history_site_visited_cb), (ephy_bookmarks_set_icon): Remove unused vars. Bad xan. * src/toolbar.c: (location_finished_cb), (toolbar_activate_location): Show the toolbar on ctrl+l, hide it again when the user finished to edit (focus out/activate) --- src/toolbar.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/toolbar.c') diff --git a/src/toolbar.c b/src/toolbar.c index 01f265a75..89c4e165d 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -36,6 +36,7 @@ #include "ephy-debug.h" #include "ephy-new-bookmark.h" #include "ephy-stock-icons.h" +#include "eggtoolbar.h" #include @@ -565,11 +566,22 @@ toolbar_edit_location (Toolbar *t) (EPHY_LOCATION_ENTRY(location)); } +static void +location_finished_cb (GtkWidget *location, GtkWidget *toolbar) +{ + gtk_widget_hide (toolbar); + + g_signal_handlers_disconnect_by_func (G_OBJECT (location), + G_CALLBACK (location_finished_cb), + toolbar); +} + void toolbar_activate_location (Toolbar *t) { EggAction *action; GtkWidget *location; + GtkWidget *location_tb; action = egg_action_group_get_action (t->priv->action_group, "Location"); @@ -577,6 +589,16 @@ toolbar_activate_location (Toolbar *t) (EPHY_LOCATION_ACTION (action)); g_return_if_fail (location != NULL); + location_tb = gtk_widget_get_ancestor (location, EGG_TYPE_TOOLBAR); + g_return_if_fail (location_tb != NULL); + + if (!GTK_WIDGET_VISIBLE (location_tb)) + { + g_signal_connect (location, "finished", + G_CALLBACK (location_finished_cb), location_tb); + gtk_widget_show (location_tb); + } + ephy_location_entry_activate (EPHY_LOCATION_ENTRY(location)); } -- cgit