changeset 7f3c66ac7b81 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=7f3c66ac7b81
description:
        Connect to button-press-event to fill the favorite menu

        The menu must be filled before the toggled event is triggered so we can 
not use
        'clicked' nor 'toggled'. Indeed 'button-press-event' is the first one 
but we
        must make the callback continue to propagate the event.

        issue9530
        review296051002
diffstat:

 tryton/gui/main.py |  5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 5e284dcd8b10 -r 7f3c66ac7b81 tryton/gui/main.py
--- a/tryton/gui/main.py        Tue Aug 11 22:06:03 2020 +0200
+++ b/tryton/gui/main.py        Sun Aug 16 16:31:23 2020 +0200
@@ -155,7 +155,7 @@
                 'tryton-bookmarks', Gtk.IconSize.BUTTON))
         self.menu_favorite = Gtk.Menu.new()
         favorite.set_popup(self.menu_favorite)
-        favorite.connect('clicked', self.favorite_set)
+        favorite.connect('button-press-event', self.favorite_set)
         self.header.pack_start(favorite)
 
         self.set_global_search()
@@ -433,7 +433,7 @@
 
     def favorite_set(self, *args):
         if self.menu_favorite.get_children():
-            return True
+            return
 
         def _action_favorite(widget, id_):
             event = Gtk.get_current_event()
@@ -466,7 +466,6 @@
         manage_favorites.connect('activate', _manage_favorites)
         self.menu_favorite.add(manage_favorites)
         self.menu_favorite.show_all()
-        return True
 
     def favorite_unset(self):
         for child in self.menu_favorite.get_children():

Reply via email to