Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@laptop.org>2012-09-02 11:43:33 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-09-02 11:43:33 (GMT)
commit1b1ea09f09dc4001698503d14c5b067636e62471 (patch)
tree57ceadd437ed9652590bd125d611d0c233227961
parent3fc7028617fe423e0e5424407f7b652dc550c76c (diff)
FavoritePalette: take into account that the first menu_item is the labelHEADmaster
Since the Palettes with a meu 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 exisiting menu item into account.
-rw-r--r--src/jarabe/desktop/favoritesview.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
index 8e50f5c..d4d1031 100644
--- a/src/jarabe/desktop/favoritesview.py
+++ b/src/jarabe/desktop/favoritesview.py
@@ -515,6 +515,8 @@ class ActivityIcon(EventIcon):
class FavoritePalette(ActivityPalette):
__gtype_name__ = 'SugarFavoritePalette'
+ _PALETTE_LABEL_OFFSET = 1
+
__gsignals__ = {
'entry-activate': (GObject.SignalFlags.RUN_FIRST,
None, ([object])),
@@ -555,7 +557,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 + _PALETTE_LABEL_OFFSET)
def __resume_entry_cb(self, menu_item, entry):
if entry is not None: