diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-23 19:26:33 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-06-23 19:26:33 (GMT) |
commit | d0cbce6d6dc4ee2f06e88741e34f511265465614 (patch) | |
tree | 644599ae6c06648714d46bfa141646bc77c04f18 /shell | |
parent | 7504297e724d2d6f1da2f07c95f560b89f07c9d7 (diff) |
Use size request rather than resize. Make the notebook
scrollable.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/WindowManager.py | 32 | ||||
-rwxr-xr-x | shell/shell.py | 1 |
2 files changed, 19 insertions, 14 deletions
diff --git a/shell/WindowManager.py b/shell/WindowManager.py index 61d1d0c..e1435ca 100644 --- a/shell/WindowManager.py +++ b/shell/WindowManager.py @@ -62,7 +62,7 @@ class WindowManager: def set_width(self, width, width_type): self._width = width self._width_type = width_type - + def set_height(self, height, height_type): self._height = height self._height_type = height_type @@ -70,7 +70,7 @@ class WindowManager: def set_position(self, position): self._position = position - def _calc_size_and_position(self): + def _update_size(self): screen_width = self._window.get_screen().get_width() screen_height = self._window.get_screen().get_height() @@ -84,6 +84,19 @@ class WindowManager: elif self._height_type is WindowManager.SCREEN_RELATIVE: height = int(screen_height * self._height) + self._real_width = width + self._real_height = height + + self._window.set_size_request(self._real_width, + self._real_height) + + def _update_position(self): + screen_width = self._window.get_screen().get_width() + screen_height = self._window.get_screen().get_height() + + width = self._real_width + height = self._real_height + if self._position is WindowManager.CENTER: self._x = int((screen_width - width) / 2) self._y = int((screen_height - height) / 2) @@ -96,17 +109,7 @@ class WindowManager: elif self._position is WindowManager.BOTTOM: self._x = int((screen_width - width) / 2) self._y = screen_height - int(self._sliding_pos * height) - - self._real_width = width - self._real_height = height - def _update_size_and_position(self): - self._calc_size_and_position() - self._window.move(self._x, self._y) - self._window.resize(self._real_width, self._real_height) - - def _update_position(self): - self._calc_size_and_position() self._window.move(self._x, self._y) def __slide_in_timeout_cb(self): @@ -161,7 +164,8 @@ class WindowManager: self._window.show() def update(self): - self._update_size_and_position() + self._update_position() def manage(self): - self._update_size_and_position() + self._update_size() + self._update_position() diff --git a/shell/shell.py b/shell/shell.py index b551478..1647314 100755 --- a/shell/shell.py +++ b/shell/shell.py @@ -326,6 +326,7 @@ class ActivityContainer(dbus.service.Object): self._fullscreen = False self.notebook = gtk.Notebook() + self.notebook.set_scrollable(True) tab_label = gtk.Label("Everyone") self._start_page = StartPage(self._signal_helper) |