[Sugar-devel] [PATCH Paint] Target rectangle in Stamp at first usage SL #3602

Manuel Quiñones manuq at laptop.org
Tue May 29 13:07:03 EDT 2012


2012/5/29 Manuel Kaufmann <humitos at gmail.com>:
> Show the target rectangle inmediatly when the Stamp tool is selected and don't
> remove the sensitive of the Stamp tool button if it's being used.

Excellent!

Tested and reviewed, all fine, pushed as
d20721442caa22d89f83b6c43d35d3aafae3f4bc

> Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
> ---
>  Area.py    |    3 +++
>  toolbox.py |    7 +++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/Area.py b/Area.py
> index fa841df..4cab9db 100644
> --- a/Area.py
> +++ b/Area.py
> @@ -786,6 +786,9 @@ class Area(gtk.DrawingArea):
>         self.resized_stamp = self.pixbuf_stamp.scale_simple(wr, hr,
>                                  gtk.gdk.INTERP_HYPER)
>
> +        # Remove selected area
> +        self.getout()
> +
>         return self.resized_stamp
>
>     def undo(self):
> diff --git a/toolbox.py b/toolbox.py
> index f781b4a..dcdfeb0 100644
> --- a/toolbox.py
> +++ b/toolbox.py
> @@ -349,8 +349,11 @@ class ToolsToolbarBuilder():
>         self._verify_sensitive_buttons()
>
>     def _verify_sensitive_buttons(self):
> -        is_selected = self._activity.area.is_selected()
> -        self._tool_stamp.set_sensitive(is_selected)
> +        # Check if there is an area selected or if the "stamp" tool is
> +        # being used
> +        sensitive = self._activity.area.is_selected() or \
> +            self.tool['name'] == 'stamp'
> +        self._tool_stamp.set_sensitive(sensitive)
>
>
>  class ButtonFillColor(ColorToolButton):
> --
> 1.7.10
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
.. manuq ..


More information about the Sugar-devel mailing list