diff options
author | Manuel Quiñones <manuq@laptop.org> | 2012-09-20 04:56:17 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2012-09-20 12:50:12 (GMT) |
commit | 2a5fd4b2d1547d1ca52ff3e5f7230456d051082a (patch) | |
tree | dbc75cc48ef197866788b22cbad2bcffc8ec40c8 /extensions | |
parent | e92baeeba033ae2fc4276ea088d6036e284dfd56 (diff) |
Port Volume palette that has mixed content to new API
This fixes VolumePalette that is used in the Journal, and in the
volume device icon.
Had to set the content box (the one passed to set_content) a property
of the palette. Otherwise the "Show Contents" can't be added from the
device icon. Previously the palette.menu attribute was used for that.
Also I had to reorder the "Show Contents" item because pack_end nor
pack_start didn't pack it to the correct place.
Note that the separator packed after the Remove item is not visible.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/deviceicon/volume.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/extensions/deviceicon/volume.py b/extensions/deviceicon/volume.py index 11a8cc9..ec7b2e2 100644 --- a/extensions/deviceicon/volume.py +++ b/extensions/deviceicon/volume.py @@ -24,7 +24,8 @@ from gi.repository import GConf from sugar3.graphics.tray import TrayIcon from sugar3.graphics.xocolor import XoColor -from sugar3.graphics.menuitem import MenuItem +from sugar3.graphics.palettemenuitem import PaletteMenuItem +from sugar3.graphics.palettemenuitem import PaletteMenuItemSeparator from sugar3.graphics.icon import Icon from jarabe.journal import journalactivity @@ -69,7 +70,7 @@ class DeviceView(TrayIcon): palette = VolumePalette(self._mount) palette.set_group_id('frame') - menu_item = MenuItem(_('Show contents')) + menu_item = PaletteMenuItem(_('Show contents')) client = GConf.Client.get_default() color = XoColor(client.get_string('/desktop/sugar/user/color')) icon = Icon(icon_name=self._icon_name, icon_size=Gtk.IconSize.MENU, @@ -78,7 +79,8 @@ class DeviceView(TrayIcon): icon.show() menu_item.connect('activate', self.__show_contents_cb) - palette.menu.insert(menu_item, 0) + palette.content_box.pack_start(menu_item, True, True, 0) + palette.content_box.reorder_child(menu_item, 0) menu_item.show() return palette |