Ticket #4157: 0001-Icon-consider-width-height-0-0-SL-4157.patch

File 0001-Icon-consider-width-height-0-0-SL-4157.patch, 1.2 KB (added by manuq, 11 years ago)
  • src/sugar3/graphics/icon.py

    From 0e85f10a49c47c4b13bf9d3402b298d839696297 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Tue, 6 Nov 2012 01:25:09 -0300
    Subject: [PATCH toolkit-gtk3] Icon: consider width, height == 0, 0 - SL #4157
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    Also activity icons that come from the remote buddy to notify
    invitations have width, height == 0, 0 .  Handle this case.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/sugar3/graphics/icon.py | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py
    index 507db41..8f6b317 100644
    a b class _IconBuffer(object): 
    185185            context.paint()
    186186
    187187    def _get_size(self, icon_width, icon_height, padding):
    188         if self.width is not None and self.height is not None:
     188        if ((self.width is not None and self.width != 0) and
     189            (self.height is not None and self.height != 0)):
    189190            width = self.width + padding
    190191            height = self.height + padding
    191192        else: