diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-03-08 20:29:10 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-03-08 20:29:10 (GMT) |
commit | 08dc98cff28e9ef480a95ca8941c2908478f5460 (patch) | |
tree | 4861074ff6f41124690e4a6cfe37207e1db44d15 /OficinaActivity.py | |
parent | c77d5a634b88a405e696a1aa93f05ab53f6a0dac (diff) |
Fix the scrollbar visible issue when reload the image or show/colapse the toolbars
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'OficinaActivity.py')
-rw-r--r-- | OficinaActivity.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OficinaActivity.py b/OficinaActivity.py index bc87a95..a74b7c1 100644 --- a/OficinaActivity.py +++ b/OficinaActivity.py @@ -145,10 +145,24 @@ class OficinaActivity(activity.Activity): def size_allocate_cb(widget, allocation): self.fixed.disconnect(self._setup_handle) self.area.setup(pixbuf.get_width(), pixbuf.get_height()) + # The scrolled window is confused with a image of the same size + # of the canvas when the toolbars popup and the scrolls + # keep visible. + if pixbuf.get_height() > allocation.height or \ + pixbuf.get_width() > allocation.width: + self.canvas.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + else: + self.canvas.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) + self.area.loadImageFromJournal(pixbuf) self.center_area() self.canvas.add_with_viewport(self.fixed) + # to remove the border, we need set the shadowtype + # in the viewport child of the scrolledwindow + self.canvas.get_children()[0].set_shadow_type(gtk.SHADOW_NONE) + self.canvas.get_children()[0].set_border_width(0) + self.disconnect(self._setup_handle) self._setup_handle = self.fixed.connect('size_allocate', size_allocate_cb) |