diff options
author | Manuel Quiñones <manuq@laptop.org> | 2013-01-03 18:52:12 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2013-01-25 14:01:22 (GMT) |
commit | ca6b1c7bd30cfefb008fcbf4b053e8092d3f9005 (patch) | |
tree | 605ddef1d23d633b5207b9e3cdde3cb543748a5f /webactivity.py | |
parent | de545fc97273db57453d3cc212ce80bb784aa9de (diff) |
Persist zoom level of tabs between sessions - SL #4368
- Read the zoom level using Dictionary.get() to make it backwards
compatible.
- Add getter and setter to DummyBrowser for the duck typing.
Initial patch from Ariel Calzada <ariel@acivitycentral.com>
Signed-off-by: Ariel Calzada <ariel@acivitycentral.com>
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Diffstat (limited to 'webactivity.py')
-rw-r--r-- | webactivity.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webactivity.py b/webactivity.py index 3c0d337..ecf84b6 100644 --- a/webactivity.py +++ b/webactivity.py @@ -411,9 +411,13 @@ class WebActivity(activity.Activity): for number, tab in enumerate(self.model.data['currents']): tab_page = self._tabbed_view.get_nth_page(number) tab_page.browser.set_history_index(tab['history_index']) + zoom_level = tab.get('zoom_level') + if zoom_level is not None: + tab_page.browser.set_zoom_level(zoom_level) tab_page.browser.grab_focus() self._tabbed_view.set_current_page(self.model.data['current_tab']) + elif self.metadata['mime_type'] == 'text/uri-list': data = self._get_data_from_file_path(file_path) uris = mime.split_uri_list(data) @@ -453,7 +457,8 @@ class WebActivity(activity.Activity): uri = n_browser.get_uri() history_index = n_browser.get_history_index() info = {'title': n_browser.props.title, 'url': uri, - 'history_index': history_index} + 'history_index': history_index, + 'zoom_level': n_browser.get_zoom_level()} self.model.data['currents'].append(info) |