diff options
author | Simon Schampijer <simon@laptop.org> | 2012-09-06 10:56:36 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-09-07 09:14:27 (GMT) |
commit | 9f2af9d8accd8832d1d962c375b6ec1fcbe3a965 (patch) | |
tree | 9d77b39f79aeac55436f53fccc919ac7e34352a9 /src | |
parent | f5d6cb7044e8b7e2d902c7a1358f3d585a7ca110 (diff) |
FavoritePalette: take into account that the first menu_item is the label
Since the Palettes with a menu are only Gtk.Menus the first item
in the menu is the label that we mark insensitive (see get_menu
in Palette). When we add the items we need to take the first
already existing menu item into account.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/jarabe/desktop/favoritesview.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index 68796d0..e44a750 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -511,6 +511,8 @@ class ActivityIcon(EventIcon): class FavoritePalette(ActivityPalette): __gtype_name__ = 'SugarFavoritePalette' + _PALETTE_LABEL_OFFSET = 1 + __gsignals__ = { 'entry-activate': (GObject.SignalFlags.RUN_FIRST, None, ([object])), @@ -551,7 +553,8 @@ class FavoritePalette(ActivityPalette): separator.show() for i in range(0, len(menu_items)): - self.menu.insert(menu_items[i], i) + # the first menu_item is the label so we need the offset + self.menu.insert(menu_items[i], i + self._PALETTE_LABEL_OFFSET) def __resume_entry_cb(self, menu_item, entry): if entry is not None: |