[Sugar-devel] [PATCH 3/3] sdxo#2316: Browse don't remember the last zoom used. In the read_file and write_file method self.model.data['current_zoom_level'] is restored/written
Ariel Calzada
ariel.calzada at gmail.com
Mon Jan 7 22:18:37 EST 2013
Done it http://bugs.sugarlabs.org/attachment/ticket/4368/
On 01/04/2013 05:00 PM, Manuel Quiñones wrote:
> Looks like a nice enhacement. Can you add a ticket with type
> "enhacement" in our sugarlabs tracker, so we can track it?
>
> 2013/1/3 Ariel Calzada<ariel.calzada at gmail.com>:
>> ---
>> webactivity.py | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/webactivity.py b/webactivity.py
>> index fc60069..a94c7fa 100644
>> --- a/webactivity.py
>> +++ b/webactivity.py
>> @@ -426,6 +426,13 @@ class WebActivity(activity.Activity):
>> tab_page.browser.grab_focus()
>>
>> self._tabbed_view.set_current_page(self.model.data['current_tab'])
>> +
>> + # zoom level
>> + if 'current_zoom_level' in self.model.data:
>> + self._tabbed_view.props.current_browser.set_zoom_level(self.model.data['current_zoom_level'])
>> + else:
>> + self._tabbed_view.props.current_browser.set_zoom_level(ZOOM_ORIGINAL)
>> +
>> elif self.metadata['mime_type'] == 'text/uri-list':
>> data = self._get_data_from_file_path(file_path)
>> uris = mime.split_uri_list(data)
>> @@ -447,6 +454,9 @@ class WebActivity(activity.Activity):
>>
>> browser = self._tabbed_view.current_browser
>>
>> + # zoom level
>> + self.model.data['current_zoom_level'] = browser.get_zoom_level()
>> +
>> if not self._jobject.metadata['title_set_by_user'] == '1':
>> if browser.props.title is None:
>> self.metadata['title'] = _('Untitled')
>> --
>> 1.7.10.4
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
More information about the Sugar-devel
mailing list