diff options
author | Simon Schampijer <simon@schampijer.de> | 2007-10-01 22:05:33 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2007-10-01 22:05:33 (GMT) |
commit | 802372fbae42bf4aba6dbbb3e92c5c090df76abc (patch) | |
tree | 0421e9b01a8cc25f8047e696025b9fc77585ae8a /webtoolbar.py | |
parent | 94c0ba36f6b34999019c99acd952a963921353a2 (diff) |
Limit to 15 entries in the palette of the back/forward buttons
Diffstat (limited to 'webtoolbar.py')
-rwxr-xr-x | webtoolbar.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webtoolbar.py b/webtoolbar.py index 098ac4d..c8cf8b3 100755 --- a/webtoolbar.py +++ b/webtoolbar.py @@ -31,6 +31,8 @@ import sessionhistory import progresslistener import filepicker +_MAX_HISTORY_ENTRIES = 16 + class WebToolbar(gtk.Toolbar): __gtype_name__ = 'WebToolbar' @@ -187,7 +189,18 @@ class WebToolbar(gtk.Toolbar): palette.menu.remove(menu_item) session_history = self._browser.web_navigation.sessionHistory - for i in range(0, session_history.count): + if session_history.count <= _MAX_HISTORY_ENTRIES \ + or current_page_index < _MAX_HISTORY_ENTRIES: + bottom = 0 + else: + bottom = session_history.count - _MAX_HISTORY_ENTRIES + + if session_history.count == current_page_index: + top = session_history.count-1 + else: + top = session_history.count + + for i in range(bottom, top): if i == current_page_index: continue |