Ticket #3936: 0002-RadioToolButton-draw-the-outline-properly-SL.patch

File 0002-RadioToolButton-draw-the-outline-properly-SL.patch, 1.8 KB (added by manuq, 11 years ago)

Toolkit patch to get the outline right. Was affecting only RadioToolButtons like the ones in the top panel of the frame, or in Paint toolbar.

  • src/sugar3/graphics/radiotoolbutton.py

    From ca0590980bb88598be448345692e5fc6dc9aaa4c Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Wed, 5 Dec 2012 14:29:17 -0300
    Subject: [PATCH toolkit 2/2] RadioToolButton: draw the outline properly - SL
     #
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    Now the do_draw method is exactly the same as the one for ToolButton.
    This considers the border that the radio button can have, which is
    needed for the changes made in the theme to get back the original
    style.
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     src/sugar3/graphics/radiotoolbutton.py | 11 ++++++-----
     1 file changed, 6 insertions(+), 5 deletions(-)
    
    diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
    index fa910fd..a51a39a 100644
    a b class RadioToolButton(Gtk.RadioToolButton): 
    132132
    133133    def do_draw(self, cr):
    134134        child = self.get_child()
    135         allocation = self.get_allocation()
    136 
    137135        if self.palette and self.palette.is_up():
    138             invoker = self.palette.props.invoker
    139             invoker.draw_rectangle(cr, self.palette)
    140 
    141136            allocation = self.get_allocation()
    142137            # draw a black background, has been done by the engine before
    143138            cr.set_source_rgb(0, 0, 0)
    class RadioToolButton(Gtk.RadioToolButton): 
    146141
    147142        Gtk.RadioToolButton.do_draw(self, cr)
    148143
     144        if self.palette and self.palette.is_up():
     145            invoker = self.palette.props.invoker
     146            invoker.draw_rectangle(cr, self.palette)
     147
     148        return False
     149
    149150    def get_hide_tooltip_on_click(self):
    150151        return self._hide_tooltip_on_click
    151152