Handle icon removal, better alignment
This commit is contained in:
parent
528dc5a046
commit
1803ab1a88
@ -148,19 +148,23 @@ class Frame:
|
|||||||
top_panel = self._create_panel(grid, 0, 0, 16, 1)
|
top_panel = self._create_panel(grid, 0, 0, 16, 1)
|
||||||
|
|
||||||
box = ZoomBox(self._shell, self._menu_shell)
|
box = ZoomBox(self._shell, self._menu_shell)
|
||||||
top_panel.append(box, hippo.PACK_FIXED)
|
|
||||||
|
|
||||||
[x, y] = grid.point(1, 0)
|
[x, y] = grid.point(1, 0)
|
||||||
|
top_panel.append(box, hippo.PACK_FIXED)
|
||||||
top_panel.move(box, x, y)
|
top_panel.move(box, x, y)
|
||||||
|
|
||||||
tray = NotificationTray()
|
tray = NotificationTray()
|
||||||
box = hippo.CanvasWidget()
|
tray_box = hippo.CanvasBox(box_width=grid.dimension(1),
|
||||||
box.props.widget = tray
|
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)
|
[x, y] = grid.point(14, 0)
|
||||||
top_panel.move(box, x, y)
|
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)
|
bottom_panel = self._create_panel(grid, 0, 11, 16, 1)
|
||||||
|
|
||||||
|
@ -8,7 +8,11 @@ class NotificationTray(gtk.HBox):
|
|||||||
|
|
||||||
self._manager = TrayManager()
|
self._manager = TrayManager()
|
||||||
self._manager.connect('tray-icon-added', self._icon_added_cb)
|
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())
|
self._manager.manage_screen(gtk.gdk.screen_get_default())
|
||||||
|
|
||||||
def _icon_added_cb(self, manager, icon):
|
def _icon_added_cb(self, manager, icon):
|
||||||
self.pack_start(icon, False)
|
self.pack_start(icon, False)
|
||||||
|
|
||||||
|
def _icon_removed_cb(self, manager, icon):
|
||||||
|
icon.destroy()
|
||||||
|
Loading…
Reference in New Issue
Block a user