Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2013-02-24 22:05:36 (GMT)
committer Walter Bender <walter.bender@gmail.com>2013-02-24 22:05:36 (GMT)
commitfe838c6a699bbc58b196ced406899e4e417fcd32 (patch)
tree0a451772e0b53df6a51e5df6726076120aff76e1
parent6bc8c7a7bb4e9dac0863257b31017af690f6488e (diff)
fixed problem with scrolled window when rotating
-rw-r--r--labyrinthactivity.py36
1 files changed, 23 insertions, 13 deletions
diff --git a/labyrinthactivity.py b/labyrinthactivity.py
index bcf36ec..51b1b22 100644
--- a/labyrinthactivity.py
+++ b/labyrinthactivity.py
@@ -34,6 +34,7 @@ from sugar.graphics.radiotoolbutton import RadioToolButton
from sugar.graphics.colorbutton import ColorToolButton
from sugar.graphics.menuitem import MenuItem
from sugar.datastore import datastore
+from sugar.graphics import style
from port.tarball import Tarball
try:
@@ -566,19 +567,18 @@ class LabyrinthActivity(activity.Activity):
self.set_canvas(self.fixed)
self._vbox = gtk.VBox()
- self._vbox.set_size_request(gtk.gdk.screen_width(),
- gtk.gdk.screen_height())
+ self._vbox.set_size_request(
+ gtk.gdk.screen_width(),
+ gtk.gdk.screen_height() - style.GRID_CELL_SIZE)
- self._sw = gtk.ScrolledWindow()
- self._vbox.pack_end(self._sw, True, True)
- self._sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
- self._sw.show()
+ self._main_area = MMapArea.MMapArea(self._undo)
self._undo.block()
- self._main_area = MMapArea.MMapArea(self._undo)
+
self._main_area.set_size_request(
max(gtk.gdk.screen_width(), gtk.gdk.screen_height()),
max(gtk.gdk.screen_width(), gtk.gdk.screen_height()))
+ self._main_area.show()
self._main_area.connect("set_focus", self.__main_area_focus_cb)
self._main_area.connect("button-press-event",
self.__main_area_focus_cb)
@@ -590,16 +590,28 @@ class LabyrinthActivity(activity.Activity):
gtk.gdk.screen_get_default().connect('size-changed',
self.__configure_cb)
+ self._sw = gtk.ScrolledWindow()
+ self._sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
self._sw.add_with_viewport(self._main_area)
- # self._vbox.pack_end(self._main_area, True, True)
-
- self.fixed.put(self._vbox, 0, 0)
- self._vbox.show()
+ self._vbox.pack_end(self._sw, True, True)
self._sw.show()
+ self._main_area.show()
+ self._vbox.show()
+ self.fixed.put(self._vbox, 0, 0)
+
self._undo.unblock()
def __configure_cb(self, event):
''' Screen size has changed '''
+ self._vbox.set_size_request(
+ gtk.gdk.screen_width(),
+ gtk.gdk.screen_height() - style.GRID_CELL_SIZE)
+
+ logging.debug(self._main_area.get_allocation())
+ self._vbox.show()
+
+ if event is None:
+ return
if gtk.gdk.screen_width() > gtk.gdk.screen_height():
self.separator_1.show()
self.separator_1.props.draw = True
@@ -797,8 +809,6 @@ class LabyrinthActivity(activity.Activity):
tar.write('MANIFEST', manifest)
self._main_area.save_thyself(tar)
- self.mods[self._mode].set_active(True)
-
tar.close()
def serialize_to_xml(self, doc, top_element):