Ticket #4253: 0002-Buddy-icons-popdown-palette-inmediatly-after-mouse-c.patch

File 0002-Buddy-icons-popdown-palette-inmediatly-after-mouse-c.patch, 3.3 KB (added by manuq, 10 years ago)

Patch.

  • src/jarabe/desktop/favoritesview.py

    From cdeb2595ebae595a15c919aa97e39437d757dd2f Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Thu, 6 Dec 2012 16:48:32 -0300
    Subject: [PATCH shell 2/2] Buddy icons: popdown palette inmediatly after
     mouse click - SL #4253
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    The current implementation of the palette requires that we explicitly
    call the popdown method of the palette after each item is activated.
    This affects the mouse interaction, in touch interaction the palette
    is dismissed correctly.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/jarabe/desktop/favoritesview.py | 6 ++++--
     src/jarabe/view/buddymenu.py        | 8 ++++++++
     2 files changed, 12 insertions(+), 2 deletions(-)
    
    diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py
    index a9358f6..c55549f 100644
    a b class OwnerIcon(BuddyIcon): 
    648648            self._register_menu = PaletteMenuItem(_('Register again'),
    649649                                                  'media-record')
    650650
    651         self._register_menu.connect('activate', self.__register_activate_cb)
     651        self._register_menu.connect('activate', self.__register_activate_cb,
     652                                    palette)
    652653        palette.menu_box.pack_end(self._register_menu, True, True, 0)
    653654        self._register_menu.show()
    654655
    class OwnerIcon(BuddyIcon): 
    656657
    657658        return palette
    658659
    659     def __register_activate_cb(self, menuitem):
     660    def __register_activate_cb(self, menuitem, palette):
     661        palette.popdown(immediate=True)
    660662        self.emit('register-activate')
    661663
    662664    def set_registered(self):
  • src/jarabe/view/buddymenu.py

    diff --git a/src/jarabe/view/buddymenu.py b/src/jarabe/view/buddymenu.py
    index e38d215..9531f95 100644
    a b class BuddyMenu(Palette): 
    117117        home_window.busy_during_delayed_action(action)
    118118
    119119    def __logout_activate_cb(self, menu_item):
     120        self.popdown(immediate=True)
    120121        self._quit(get_session_manager().logout)
    121122
    122123    def __reboot_activate_cb(self, menu_item):
     124        self.popdown(immediate=True)
    123125        self._quit(get_session_manager().reboot)
    124126
    125127    def __shutdown_activate_cb(self, menu_item):
     128        self.popdown(immediate=True)
    126129        self._quit(get_session_manager().shutdown)
    127130
    128131    def __controlpanel_activate_cb(self, menu_item):
     132        self.popdown(immediate=True)
     133
    129134        # hide the frame when control panel is shown
    130135        import jarabe.frame
    131136        frame = jarabe.frame.get_view()
    class BuddyMenu(Palette): 
    165170        self.set_primary_text(GLib.markup_escape_text(buddy.props.nick))
    166171
    167172    def _make_friend_cb(self, menuitem):
     173        self.popdown(immediate=True)
    168174        friends.get_model().make_friend(self._buddy)
    169175
    170176    def _remove_friend_cb(self, menuitem):
     177        self.popdown(immediate=True)
    171178        friends.get_model().remove(self._buddy)
    172179
    173180    def _invite_friend_cb(self, menuitem):
     181        self.popdown(immediate=True)
    174182        activity = shell.get_model().get_active_activity()
    175183        service = activity.get_service()
    176184        if service: