Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ImageViewerActivity.py
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-03-24 19:20:03 (GMT)
committer Sayamindu Dasgupta <sayamindu@gmail.com>2009-03-24 19:24:06 (GMT)
commita415de1a2b3954982e2561761ba2cb11332c98b5 (patch)
tree64d038729ee7694260f7eb873d9030dd25cb289d /ImageViewerActivity.py
parent4031c8b29fb449682b12091b55704eca63cab66e (diff)
Fix initial zoom level being extremely small (#dslo:486)
Diffstat (limited to 'ImageViewerActivity.py')
-rw-r--r--ImageViewerActivity.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ImageViewerActivity.py b/ImageViewerActivity.py
index b72d617..91de299 100644
--- a/ImageViewerActivity.py
+++ b/ImageViewerActivity.py
@@ -93,13 +93,17 @@ class ImageViewerActivity(activity.Activity):
'tmp%i' % time.time())
os.link(file_path, tempfile)
-
- self.view.set_file_location(tempfile)
+ gobject.idle_add(self.__set_file_idle_cb, tempfile)
+
+ def __set_file_idle_cb(self, file_path):
+ self.view.set_file_location(file_path)
self.zoom = int(self.metadata.get('zoom', '0'))
if self.zoom > 0:
self.view.set_zoom(self.zoom)
+ return True
+
def write_file(self, file_path):
self.metadata['zoom'] = str(self.zoom)