From e49146752ff322c53430419749be53b741f02540 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 26 Apr 2007 09:31:41 +0000 Subject: More work on the new graphics API. --- (limited to 'shell') diff --git a/shell/view/frame/PanelWindow.py b/shell/view/frame/PanelWindow.py index 7f585b6..5dfe446 100644 --- a/shell/view/frame/PanelWindow.py +++ b/shell/view/frame/PanelWindow.py @@ -18,11 +18,10 @@ import gtk import hippo from sugar.graphics import units -from sugar.graphics.window import Window -class PanelWindow(Window): +class PanelWindow(gtk.Window): def __init__(self, orientation): - Window.__init__(self) + gtk.Window.__init__(self) self.hover = False self._orientation = orientation @@ -32,9 +31,13 @@ class PanelWindow(Window): self.connect('enter-notify-event', self._enter_notify_cb) self.connect('leave-notify-event', self._leave_notify_cb) + self._canvas = hippo.Canvas() + self.add(self._canvas) + self._canvas.show() + self._bg = hippo.CanvasBox(background_color=0x414141ff, orientation=self._orientation) - self.set_root(self._bg) + self._canvas.set_root(self._bg) self._update_size() diff --git a/shell/view/home/HomeWindow.py b/shell/view/home/HomeWindow.py index 3f33919..c65432d 100644 --- a/shell/view/home/HomeWindow.py +++ b/shell/view/home/HomeWindow.py @@ -54,7 +54,7 @@ class HomeWindow(Window): self._mesh_box = MeshBox(shell, MenuShell(self)) self._transition_box = TransitionBox() - self.set_root(self._home_box) + self.canvas.set_root(self._home_box) self._transition_box.connect('completed', self._transition_completed_cb) @@ -81,7 +81,7 @@ class HomeWindow(Window): def set_zoom_level(self, level): self._level = level - self.set_root(self._transition_box) + self.canvas.set_root(self._transition_box) if level == sugar.ZOOM_HOME: scale = units.XLARGE_ICON_SCALE @@ -94,11 +94,11 @@ class HomeWindow(Window): def _transition_completed_cb(self, transition_box): if self._level == sugar.ZOOM_HOME: - self.set_root(self._home_box) + self.canvas.set_root(self._home_box) elif self._level == sugar.ZOOM_FRIENDS: - self.set_root(self._friends_box) + self.canvas.set_root(self._friends_box) elif self._level == sugar.ZOOM_MESH: - self.set_root(self._mesh_box) + self.canvas.set_root(self._mesh_box) self._update_mesh_state() -- cgit v0.9.1