[Skencil-commits] r801 - skencil/branches/skencil-0.6/src/Sketch/UI

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 6 21:32:30 CET 2011


Author: bh
Date: 2011-02-06 21:32:29 +0100 (Sun, 06 Feb 2011)
New Revision: 801

Modified:
   skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
   skencil/branches/skencil-0.6/src/Sketch/UI/ruler.py
Log:
Do not access the ui_colors directly in ruler.py. Pass the colors as a
mandatory parameter into the class.

This prepares for the removal of the gtkutils calls in the main Sketch
package.


Modified: skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py	2011-02-06 20:28:09 UTC (rev 800)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py	2011-02-06 20:32:29 UTC (rev 801)
@@ -599,10 +599,10 @@
         vbar.grid(in_ = frame, column = 2, row = 1, sticky = 'ns')
         hbar = Scrollbar(frame, orient = HORIZONTAL)
         hbar.grid(in_ = frame, column = 1, row = 2, sticky = 'ew')
-        hrule = ruler.Ruler(root, ruler.HORIZONTAL)
+        hrule = ruler.Ruler(root, ruler.HORIZONTAL, Sketch.ui_colors)
         hrule.grid(in_ = frame, column = 1, row = 0, sticky = 'ew',
                    columnspan = 2)
-        vrule = ruler.Ruler(root, ruler.VERTICAL)
+        vrule = ruler.Ruler(root, ruler.VERTICAL, Sketch.ui_colors)
         vrule.grid(in_ = frame, column = 0, row = 1, sticky = 'ns',
                    rowspan = 2)
         tmp = Frame(frame, name = 'rulercorner')

Modified: skencil/branches/skencil-0.6/src/Sketch/UI/ruler.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/ruler.py	2011-02-06 20:28:09 UTC (rev 800)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/ruler.py	2011-02-06 20:32:29 UTC (rev 801)
@@ -20,7 +20,7 @@
 import operator
 
 from Sketch import GraphicsDevice, Identity, gtkutils
-from Sketch import config, const, GuideLine, Point, ui_colors
+from Sketch import config, const, GuideLine, Point
 from Sketch.const import CHANGED
 from Sketch.Graphics.color import XRGBColor
 
@@ -84,7 +84,7 @@
 
 class Ruler(PyWidget):
 
-    def __init__(self, master, orient, canvas=None, **kw):
+    def __init__(self, master, orient, colors, canvas=None, **kw):
         apply(PyWidget.__init__, (self, master), kw)
         self.orient = orient
         self.canvas = canvas
@@ -99,13 +99,13 @@
         self['height'] = 19
         self['width'] = 19
 
-        self.border_color = XRGBColor(ui_colors.light_border)
-        self.bg_color = XRGBColor(ui_colors.menubackground)
-        self.fg_color = XRGBColor(ui_colors.fg)
+        self.border_color = XRGBColor(colors.light_border)
+        self.bg_color = XRGBColor(colors.menubackground)
+        self.fg_color = XRGBColor(colors.fg)
 
         self.gradient = []
-        start = ui_colors.menubackground
-        stop = ui_colors.light_border
+        start = colors.menubackground
+        stop = colors.light_border
         for pos in range(20):
             color = gtkutils.middle_color(start, stop, pos * 3.5 /100)
             self.gradient.append(XRGBColor(color))



More information about the Skencil-commits mailing list