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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Oct 9 03:10:20 CEST 2010


Author: igor_n
Date: 2010-10-09 03:10:19 +0200 (Sat, 09 Oct 2010)
New Revision: 753

Modified:
   skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
   skencil/branches/skencil-0.6/src/Sketch/UI/palette.py
   skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py
Log:
color palette redesign

Modified: skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py	2010-10-08 23:23:35 UTC (rev 752)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/mainwindow.py	2010-10-09 01:10:19 UTC (rev 753)
@@ -590,7 +590,7 @@
         self.status_bar.pack(side = BOTTOM, fill=X)
 
         palette_frame = Frame(root, name = 'palette_frame')
-        palette_frame.pack(side = BOTTOM, fill = X, pady = 3)
+        palette_frame.pack(side = BOTTOM, fill = X, pady = 5)
 
         frame = Frame(root, name = 'canvas_frame')
         frame.pack(side = TOP, fill = BOTH, expand = 1, padx = 4)
@@ -648,10 +648,10 @@
             button = UpdatedButton(palette_frame, bitmap = bitmap,
                                    command = command, args = args,
                                    sensitivecb = sensitivecb)
-            button.pack(side = LEFT)
+            button.pack(side = LEFT, anchor = 'w')
             self.palette.Subscribe(VIEW, button.Update)
             if bitmap == pixmaps.ArrLeft:
-                self.palette.pack(side = LEFT, fill = X, expand = 1)
+                self.palette.pack(side = LEFT, fill = X, expand = 1, padx = 1)
 
         self.palette.Subscribe(COLOR1, self.canvas.FillSolid)
         self.palette.Subscribe(COLOR2, self.canvas.LineColor)

Modified: skencil/branches/skencil-0.6/src/Sketch/UI/palette.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/palette.py	2010-10-08 23:23:35 UTC (rev 752)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/palette.py	2010-10-09 01:10:19 UTC (rev 753)
@@ -274,9 +274,9 @@
 
 class PaletteWidget(PyWidget, Publisher):
 
-    def __init__(self, master=None, palette = None, cell_size = 16, **kw):
+    def __init__(self, master=None, palette = None, cell_size = 37, **kw):
         if not kw.has_key('height'):
-            kw['height'] = cell_size
+            kw['height'] = 18
         apply(PyWidget.__init__, (self, master), kw)
 
         self.cell_size = cell_size
@@ -293,14 +293,14 @@
         self.bind('<ButtonPress-1>', self.press_1)
         self.bind('<Motion>', self.move_1)
         self.bind('<ButtonRelease-1>', self.release_1)
-        self.bind('<ButtonRelease-2>', self.apply_color_2)
+        self.bind('<ButtonRelease-3>', self.apply_color_2)
 
     def DestroyMethod(self):
         self.palette.Unsubscribe(CHANGED, self.palette_changed)
         Publisher.Destroy(self)
 
     def compute_num_cells(self):
-        self.num_cells = self.tkwin.width / self.cell_size
+        self.num_cells = self.tkwin.width / self.cell_size + 1
 
     def MapMethod(self):
         self.compute_num_cells()
@@ -392,7 +392,7 @@
         width = win.width
         height = win.height
         self.gc.StartDblBuffer()
-        self.gc.SetFillColor(StandardColors.white)
+        self.gc.SetFillColor(StandardColors.black)
         self.gc.FillRectangle(0, 0, width, height)
 
         x = 0
@@ -403,8 +403,8 @@
         rgbs = rgbs[self.start_idx:self.start_idx + self.num_cells]
         for rgb in rgbs:
             SetFillColor(apply(create_color, rgb))
-            FillRectangle(x, 0, x + height, height)
-            x = x + height
+            FillRectangle(x + 1, 1, x + self.cell_size, height - 1)
+            x = x + self.cell_size
         self.gc.EndDblBuffer()
 
     def ResizedMethod(self, width, height):

Modified: skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py
===================================================================
--- skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py	2010-10-08 23:23:35 UTC (rev 752)
+++ skencil/branches/skencil-0.6/src/Sketch/UI/tkext.py	2010-10-09 01:10:19 UTC (rev 753)
@@ -479,8 +479,8 @@
 
     def __init__(self, *arg, **kw):
         apply(UpdatedButton.__init__, (self,) + arg, kw)
-        self.bind('<ButtonPress-2>', self.press)
-        self.bind('<ButtonRelease-2>', self.release)
+        self.bind('<ButtonPress-3>', self.press)
+        self.bind('<ButtonRelease-3>', self.release)
         self.two = 0
 
     def press(self, event):



More information about the Skencil-commits mailing list