Ticket #3989: 0001-CanvasIcon-check-if-we-have-a-palette-in-the-button-.patch

File 0001-CanvasIcon-check-if-we-have-a-palette-in-the-button-.patch, 1.2 KB (added by manuq, 10 years ago)

Fixup patch for toolkit - palette in buddy icon

  • src/sugar3/graphics/icon.py

    From ac38509396e551a480276803fdfcaa7f98b51355 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 15 Oct 2012 10:53:18 -0300
    Subject: [PATCH toolkit] CanvasIcon: check if we have a palette in the button
     release callback
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    The buddy icon in the home view has the mouse pointer inside at boot,
    moving the pointer outside provokes an error because the icon doesn't
    have a palette attached yet.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/sugar3/graphics/icon.py | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py
    index 2d9c531..95a72b8 100644
    a b class CanvasIcon(EventIcon): 
    721721            self.set_state(Gtk.StateFlags.PRELIGHT)
    722722
    723723    def __leave_notify_event_cb(self, icon, event):
    724         if self.palette.is_up():
     724        if self.palette and self.palette.is_up():
    725725            return
    726726
    727727        self._in_prelight_state = False