Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/toolbox.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-06-28 14:39:08 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-08-10 13:49:29 (GMT)
commit16c5b2406cac683eb7009ae84f0c6a4db36cf7c7 (patch)
tree5ec963b75f2d865e9a9a33fcffee5b475898bef5 /toolbox.py
parent6d884b54e61a4b9eaa0429fac0695bfee7d3b811 (diff)
First stage of port of Paint to cairo
Brushes and shapes are working. NOTES: * The pixmaps used as canvas has been replaced by ImageSurface and cairo context. * All the gc with tool properties were removed. * The variables needed by the freeform and rainbow were moved from Area to Desenha * The freeform code was simplified. * The heart is draw using cairo curves and is a little different than before. * I am using cairo_stroke_color and cairo_fill_color values in the tool dict to enable compatibility while the port is done, later will be unified. I am setting this color with a fixed alpha of 0.3 to display artifacts if we want enable alpha in the future. It's only for test at this stage. * The code used to display the polygons (triangle, trapezoid, arrow, paralellogram, star, polygon_regular) was simplified calling a method _draw_polygon witha array of points. PENDING: * All the clipboard operations. * All the efects. * Text * Bucket * Stamps
Diffstat (limited to 'toolbox.py')
-rw-r--r--toolbox.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolbox.py b/toolbox.py
index 8d58306..b5d1e1c 100644
--- a/toolbox.py
+++ b/toolbox.py
@@ -336,6 +336,12 @@ class ToolsToolbarBuilder():
self._activity.area.set_stroke_color(new_color)
self.properties['stroke color'] = new_color
+ if isinstance(new_color, unicode):
+ new_color = gtk.gdk.Color(new_color)
+ self.properties['cairo_stroke_color'] = (new_color.red_float,
+ new_color.green_float,
+ new_color.blue_float, 0.3)
+
def _on_signal_undo_cb(self, widget, data=None):
self._verify_sensitive_buttons()
@@ -378,6 +384,12 @@ class ButtonFillColor(ColorToolButton):
self._activity.area.set_fill_color(new_color)
self.properties['fill color'] = new_color
+ if isinstance(new_color, unicode):
+ new_color = gtk.gdk.Color(new_color)
+ self.properties['cairo_fill_color'] = (new_color.red_float,
+ new_color.green_float,
+ new_color.blue_float, 0.3)
+
def create_palette(self):
self._palette = self.get_child().create_palette()
color_palette_hbox = self._palette._picker_hbox