From 8344bc78c1bfc2e200c4525f07c4e50ba77f279d Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sun, 9 Sep 2007 22:43:58 +0000 Subject: Makes tooltips for Back and Forward buttons display the titles of relative 2007-09-10 Cosimo Cecchi * src/ephy-toolbar.c: (ephy_toolbar_set_navigation_tooltips): * src/ephy-toolbar.h: * src/ephy-window.c: (sync_tab_navigation): Makes tooltips for Back and Forward buttons display the titles of relative pages. Fixes bug #341400. Patch by Cyril Brulebois. svn path=/trunk/; revision=7364 --- src/ephy-window.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 6865c6909..dc9366d20 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1474,6 +1474,10 @@ sync_tab_navigation (EphyTab *tab, { EphyTabNavigationFlags flags; gboolean up = FALSE, back = FALSE, forward = FALSE; + EphyEmbed *embed; + char *back_url = NULL, *forward_url = NULL; + char *back_title = NULL, *forward_title = NULL; + gint position; if (window->priv->closing) return; @@ -1494,6 +1498,32 @@ sync_tab_navigation (EphyTab *tab, ephy_toolbar_set_navigation_actions (window->priv->toolbar, back, forward, up); + + embed = ephy_tab_get_embed (tab); + if (embed == NULL) return; + + position = ephy_embed_shistory_get_pos (embed); + + if (position > 0) + { + ephy_embed_shistory_get_nth (embed, -1, TRUE, + &back_url, &back_title); + } + + if (position < ephy_embed_shistory_n_items (embed) - 1) + { + ephy_embed_shistory_get_nth (embed, 1, TRUE, + &forward_url, &forward_title); + } + + ephy_toolbar_set_navigation_tooltips (window->priv->toolbar, + back_title, + forward_title); + + g_free (back_title); + g_free (back_url); + g_free (forward_title); + g_free (forward_url); } static void -- cgit v1.2.3