From 1803ab1a88dae40d516e2b63c9d4b5cc645453bd Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 16 Oct 2006 18:42:39 +0000 Subject: Handle icon removal, better alignment --- (limited to 'shell') diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py index 03c11d7..a48b6dd 100644 --- a/shell/view/frame/Frame.py +++ b/shell/view/frame/Frame.py @@ -148,19 +148,23 @@ class Frame: top_panel = self._create_panel(grid, 0, 0, 16, 1) box = ZoomBox(self._shell, self._menu_shell) - top_panel.append(box, hippo.PACK_FIXED) [x, y] = grid.point(1, 0) + top_panel.append(box, hippo.PACK_FIXED) top_panel.move(box, x, y) tray = NotificationTray() - box = hippo.CanvasWidget() - box.props.widget = tray + tray_box = hippo.CanvasBox(box_width=grid.dimension(1), + box_height=grid.dimension(1), + xalign=hippo.ALIGNMENT_END) - top_panel.append(box, hippo.PACK_FIXED) + tray_widget = hippo.CanvasWidget() + tray_widget.props.widget = tray + tray_box.append(tray_widget, gtk.EXPAND) - [x, y] = grid.point(5, 0) - top_panel.move(box, x, y) + [x, y] = grid.point(14, 0) + top_panel.append(tray_box, hippo.PACK_FIXED) + top_panel.move(tray_box, x, y) bottom_panel = self._create_panel(grid, 0, 11, 16, 1) diff --git a/shell/view/frame/notificationtray.py b/shell/view/frame/notificationtray.py index 1a6986c..5fa5123 100644 --- a/shell/view/frame/notificationtray.py +++ b/shell/view/frame/notificationtray.py @@ -8,7 +8,11 @@ class NotificationTray(gtk.HBox): self._manager = TrayManager() self._manager.connect('tray-icon-added', self._icon_added_cb) + self._manager.connect('tray-icon-removed', self._icon_removed_cb) self._manager.manage_screen(gtk.gdk.screen_get_default()) def _icon_added_cb(self, manager, icon): self.pack_start(icon, False) + + def _icon_removed_cb(self, manager, icon): + icon.destroy() -- cgit v0.9.1