diff options
author | Ayush Goyal <ayush@seeta.in> | 2010-10-20 14:02:32 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@sugarlabs.org> | 2010-10-20 15:57:35 (GMT) |
commit | 8a99b79985995d2e796f655dc0984f8e8b7afbbe (patch) | |
tree | dfd7d82cdb977f18d9668d88db58b2072e21df14 /toolbox.py | |
parent | fdce651dad14009690c88324c96e10a61d36831d (diff) |
Implemented Mirroring Effect in Paint Activity (SL#2463)
Two mirror effects 'Mirror Horizontal' and 'Mirror Vertical' have been added.
Mirror horizontal tool flips the entire image or selected area horizontally.
Mirror vertical tool does the same vertically.
Signed-off-by: Ayush Goyal <ayush@seeta.in>
Diffstat (limited to 'toolbox.py')
-rw-r--r-- | toolbox.py | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1276,6 +1276,16 @@ class EffectsToolbar(gtk.Toolbar): separator = gtk.SeparatorToolItem() self.insert(separator, -1) + self._mirror_horizontal = ToolButton('mirror-horizontal') + self.insert(self._mirror_horizontal, -1) + self._mirror_horizontal.show() + self._mirror_horizontal.set_tooltip(_('Mirror Horizontal')) + + self._mirror_vertical = ToolButton('mirror-vertical') + self.insert(self._mirror_vertical, -1) + self._mirror_vertical.show() + self._mirror_vertical.set_tooltip(_('Mirror Vertical')) + """ #FIXME: Must be implemented self._black_and_white = ToolButton('black_and_white') @@ -1290,6 +1300,8 @@ class EffectsToolbar(gtk.Toolbar): self._effect_grayscale.connect('clicked', self.grayscale) self._effect_rainbow.connect('clicked', self.rainbow) self._invert_colors.connect('clicked', self.invert_colors) + self._mirror_vertical.connect('clicked', self.mirror_vertical) + self._mirror_horizontal.connect('clicked', self.mirror_horizontal) ##Make the colors be in grayscale def grayscale(self, widget): @@ -1302,6 +1314,12 @@ class EffectsToolbar(gtk.Toolbar): def invert_colors(self, widget): self._activity.area.invert_colors(widget) + def mirror_horizontal(self, widget): + self._activity.area.mirror(widget) + + def mirror_vertical(self, widget): + self._activity.area.mirror(widget, horizontal=False) + # setting cursor: moved to Area def _configure_palette(self, button, tool=None): |