[Sugar-devel] [sugar-toolkit-gtk3] Set getter an setter in icon_name property - SL #3849

Manuel Quiñones manuq at laptop.org
Tue Sep 18 12:35:54 EDT 2012


Oh wait I overlooked this.  What's the benefit of having two
properties exactly the same? I would vote to use named_icon as in the
constructor, and change Paint.

2012/9/18 Manuel Quiñones <manuq at laptop.org>:
> Thanks Gonzalo.  Yes this fixes the regression, which was affecting
> Paint, and may affect other ports so I vote for adding this instead of
> deprecating the API.  So now both:
>
> radial_button = RadioToolButton(named_icon='view-radial')
>
> and:
>
> radial_button = RadioToolButton()
> radial_button.props.icon_name = 'view-radial'
>
> works.  Great.
>
> 2012/9/18  <godiard at sugarlabs.org>:
>> From: Gonzalo Odiard <godiard at gmail.com>
>>
>> With g-i bindings, setting the property don't change the size
>> and the button is bigger than should be.
>> Now we have two properties for the same, icon_name and named_icon,
>> maybe one should be deprecated.
>>
>> Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
>
> Acked-by: Manuel Quiñones <manuq at laptop.org>
>
>> ---
>>  src/sugar3/graphics/radiotoolbutton.py | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
>> index 006d167..0c44347 100644
>> --- a/src/sugar3/graphics/radiotoolbutton.py
>> +++ b/src/sugar3/graphics/radiotoolbutton.py
>> @@ -131,6 +131,9 @@ class RadioToolButton(Gtk.RadioToolButton):
>>      named_icon = GObject.property(type=str, setter=set_named_icon,
>>                                    getter=get_named_icon)
>>
>> +    icon_name = GObject.property(type=str, setter=set_named_icon,
>> +                                  getter=get_named_icon)
>
> I will take care of the indentation here before pushing.
>
>> +
>>      def set_xo_color(self, xo_color):
>>          if self._xo_color != xo_color:
>>              self._xo_color = xo_color
>> --
>> 1.7.11.4
>>
>> _______________________________________________
>> Sugar-devel mailing list
>> Sugar-devel at lists.sugarlabs.org
>> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>
>
> --
> .. manuq ..



-- 
.. manuq ..


More information about the Sugar-devel mailing list