Ticket #4098: 0002-FavoritesView-fix-icons-offset-SL-4098.patch

File 0002-FavoritesView-fix-icons-offset-SL-4098.patch, 1.4 KB (added by manuq, 8 years ago)

Patch, depends on humitos patch for #3925 being applied first.

  • src/jarabe/desktop/favoriteslayout.py

    From a79c150af49eff8754df31a464db0b72c558dc04 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Fri, 8 Feb 2013 09:38:30 -0300
    Subject: [PATCH 2/2] FavoritesView: fix icons offset - SL #4098
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    Now that we added the background feedback for press and hover, the
    allocated size for each CanvasIcon is bigger than the graphic size.
    Adjust the allocation algorithm accordingly.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/jarabe/desktop/favoriteslayout.py | 5 +++++
     1 file changed, 5 insertions(+)
    
    diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py
    index 1d4d63e..9f0db09 100644
    a b class RingLayout(ViewLayout): 
    403403            # coordinate for the top of the icon.
    404404            y += icon_size / 2
    405405
     406            # The child size can be bigger than the icon size because
     407            # of the feedback on mouse over and press.
     408            x -= (child.get_preferred_width()[0] - icon_size) / 2
     409            y -= (child.get_preferred_height()[0] - icon_size) / 2
     410
    406411            child.set_size(icon_size)
    407412            new_width = child.get_preferred_width()[0]
    408413            new_height = child.get_preferred_height()[0]