While you are here, can see <a href="http://bugs.sugarlabs.org/ticket/3388">http://bugs.sugarlabs.org/ticket/3388</a> ?<div><br></div><div>Gonzalo<br><br><div class="gmail_quote">On Thu, Aug 23, 2012 at 8:58 AM, Manuel Quiņones <span dir="ltr"><<a href="mailto:manuq@laptop.org" target="_blank">manuq@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2012/8/23 Simon Schampijer <<a href="mailto:simon@schampijer.de">simon@schampijer.de</a>>:<br>
<div class="im">> On 08/23/2012 07:12 AM, Manuel Quiņones wrote:<br>
>><br>
>> gtk_paint_box is deprecated [1] and now we can use the CSS to change<br>
>> the style of the button's prelight state.<br>
>><br>
>> To test the buttons, I provide a patch for HelloWorld activity [2].<br>
>> They are added in the main toolbar.<br>
><br>
><br>
> We should really make sure we have a test-suite for the toolkit/artwork. At<br>
> the moment we are only patching while going ;p<br>
<br>
</div>Yes! I was thinking the same. So there is the 'tests' directory in<br>
sugar-toolkit-gtk3, we have to improve it. We need something like a<br>
test activity where we can add toolbuttons to the toolbar, for<br>
example.<br>
<div class="im"><br>
>> Signed-off-by: Manuel Quiņones <<a href="mailto:manuq@laptop.org">manuq@laptop.org</a>><br>
>><br>
>> [1] <a href="http://developer.gnome.org/gtk3/stable/GtkStyle.html#gtk-paint-box" target="_blank">http://developer.gnome.org/gtk3/stable/GtkStyle.html#gtk-paint-box</a><br>
>> [2] <a href="http://dev.laptop.org/~manuq/shell-port/test_gtk3_buttons.patch" target="_blank">http://dev.laptop.org/~manuq/shell-port/test_gtk3_buttons.patch</a><br>
><br>
><br>
> Cool, while trying this out I came across the issue that when the you click<br>
> on the colorbutton the size changes and therefore there is a gap between<br>
> toolbar and Palette. Looking at gtk-widgets.css.em this is causing this<br>
> (border-width):<br>
<br>
</div>Yes I've seen that too, this is work to be done in the theme. And the<br>
prelight for that button should be fixed too.<br>
<div class="im"><br>
> .button:focused {<br>
> border-width: $(thickness)px;<br>
> border-color: @white;<br>
> border-style: solid;<br>
> }<br>
<br>
</div>Ah seems you already started :)<br>
<div class="im"><br>
> We should find out for which exact use cases it is there. git-blame only<br>
> told me that it has been added in the general conversion.<br>
<br>
</div>I can continue checking from there, thanks.<br>
<div><div class="h5"><br>
><br>
>> src/sugar3/graphics/colorbutton.py | 14 ++++----------<br>
>> src/sugar3/graphics/radiotoolbutton.py | 14 ++++----------<br>
>> src/sugar3/graphics/toggletoolbutton.py | 14 ++++----------<br>
>> 3 files changed, 12 insertions(+), 30 deletions(-)<br>
>><br>
>> diff --git a/src/sugar3/graphics/colorbutton.py<br>
>> b/src/sugar3/graphics/colorbutton.py<br>
>> index 95d023a..0783481 100644<br>
>> --- a/src/sugar3/graphics/colorbutton.py<br>
>> +++ b/src/sugar3/graphics/colorbutton.py<br>
>> @@ -523,20 +523,14 @@ class ColorToolButton(Gtk.ToolItem):<br>
>><br>
>> title = GObject.property(type=str, getter=get_title,<br>
>> setter=set_title)<br>
>><br>
>> - def do_expose_event(self, event):<br>
>> + def do_draw(self, cr):<br>
>> child = self.get_child()<br>
>> allocation = self.get_allocation()<br>
>> if self._palette and self._palette.is_up():<br>
>> invoker = self._palette.props.invoker<br>
>> - invoker.draw_rectangle(event, self._palette)<br>
>> - elif child.state == Gtk.StateType.PRELIGHT:<br>
>> - child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,<br>
>> - Gtk.ShadowType.NONE, event.area,<br>
>> - child, 'toolbutton-prelight',<br>
>> - allocation.x, allocation.y,<br>
>> - allocation.width, allocation.height)<br>
>> -<br>
>> - Gtk.ToolButton.do_expose_event(self, event)<br>
>> + invoker.draw_rectangle(cr, self._palette)<br>
>> +<br>
>> + Gtk.ToolButton.do_draw(self, cr)<br>
><br>
><br>
> In the toolbutton we have a more detailed drawing. We should see how it<br>
> exactly differs and if we need to do similar here.<br>
<br>
</div></div>Ok! I will check.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
>> def __notify_change(self, widget, pspec):<br>
>> self.notify(<a href="http://pspec.name" target="_blank">pspec.name</a>)<br>
>> diff --git a/src/sugar3/graphics/radiotoolbutton.py<br>
>> b/src/sugar3/graphics/radiotoolbutton.py<br>
>> index 8fd01f7..d843b1f 100644<br>
>> --- a/src/sugar3/graphics/radiotoolbutton.py<br>
>> +++ b/src/sugar3/graphics/radiotoolbutton.py<br>
>> @@ -165,18 +165,12 @@ class RadioToolButton(Gtk.RadioToolButton):<br>
>> palette_invoker = GObject.property(<br>
>> type=object, setter=set_palette_invoker,<br>
>> getter=get_palette_invoker)<br>
>><br>
>> - def do_expose_event(self, event):<br>
>> + def do_draw(self, cr):<br>
>> child = self.get_child()<br>
>> allocation = self.get_allocation()<br>
>><br>
>> if self.palette and self.palette.is_up():<br>
>> invoker = self.palette.props.invoker<br>
>> - invoker.draw_rectangle(event, self.palette)<br>
>> - elif child.state == Gtk.StateType.PRELIGHT:<br>
>> - child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,<br>
>> - Gtk.ShadowType.NONE, event.area,<br>
>> - child, 'toolbutton-prelight',<br>
>> - allocation.x, allocation.y,<br>
>> - allocation.width, allocation.height)<br>
>> -<br>
>> - Gtk.RadioToolButton.do_expose_event(self, event)<br>
>> + invoker.draw_rectangle(cr, self.palette)<br>
>> +<br>
>> + Gtk.RadioToolButton.do_draw(self, cr)<br>
>> diff --git a/src/sugar3/graphics/toggletoolbutton.py<br>
>> b/src/sugar3/graphics/toggletoolbutton.py<br>
>> index c865332..63f4ed6 100644<br>
>> --- a/src/sugar3/graphics/toggletoolbutton.py<br>
>> +++ b/src/sugar3/graphics/toggletoolbutton.py<br>
>> @@ -113,20 +113,14 @@ class ToggleToolButton(Gtk.ToggleToolButton):<br>
>> accelerator = GObject.property(type=str, setter=set_accelerator,<br>
>> getter=get_accelerator)<br>
>><br>
>> - def do_expose_event(self, event):<br>
>> + def do_draw(self, cr):<br>
>> allocation = self.get_allocation()<br>
>> child = self.get_child()<br>
>><br>
>> if self.palette and self.palette.is_up():<br>
>> invoker = self.palette.props.invoker<br>
>> - invoker.draw_rectangle(event, self.palette)<br>
>> - elif child.state == Gtk.StateType.PRELIGHT:<br>
>> - child.style.paint_box(event.window, Gtk.StateType.PRELIGHT,<br>
>> - Gtk.ShadowType.NONE, event.area,<br>
>> - child, 'toolbutton-prelight',<br>
>> - allocation.x, allocation.y,<br>
>> - allocation.width, allocation.height)<br>
>> -<br>
>> - Gtk.ToggleToolButton.do_expose_event(self, event)<br>
>> + invoker.draw_rectangle(cr, self.palette)<br>
>> +<br>
>> + Gtk.ToggleToolButton.do_draw(self, cr)<br>
>><br>
>> palette = property(get_palette, set_palette)<br>
>><br>
><br>
> Thanks,<br>
> Simon<br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
.. manuq ..<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</div></div></blockquote></div><br></div>