diff options
author | Cosimo Cecchi <cosimoc@svn.gnome.org> | 2007-09-10 06:43:58 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@src.gnome.org> | 2007-09-10 06:43:58 +0800 |
commit | 8344bc78c1bfc2e200c4525f07c4e50ba77f279d (patch) | |
tree | 5bd2b6e69472798bca91ebe89e4b40f3dc41ddb1 /src/ephy-window.c | |
parent | 7a9491270389f22445a70f56aadf25d140960836 (diff) | |
download | gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar.gz gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar.bz2 gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar.lz gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar.xz gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.tar.zst gsoc2013-epiphany-8344bc78c1bfc2e200c4525f07c4e50ba77f279d.zip |
Makes tooltips for Back and Forward buttons display the titles of relative
2007-09-10 Cosimo Cecchi <cosimoc@svn.gnome.org>
* 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
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r-- | src/ephy-window.c | 30 |
1 files changed, 30 insertions, 0 deletions
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 |