Extract PADDING constant - padding in buttons (now 4px).

portnov [2008-08-23 11:44:37]
Extract PADDING constant - padding in buttons (now 4px).
Filename
qwerty.py
diff --git a/qwerty.py b/qwerty.py
index cb91c3d..2884f75 100755
--- a/qwerty.py
+++ b/qwerty.py
@@ -17,6 +17,8 @@ GLOBAL = 0
 SECTION = 1
 KEY = 2

+PADDING = 4
+
 KEYS = [ "QWERTYUIOP",
          "ASDFGHJKL",
          "ZXCVBNM" ]
@@ -84,10 +86,10 @@ class SuperButton(gtk.DrawingArea):
         cr.paint()

     def draw_button(self,cr):
-        cr.rectangle(4,4,self.width-8,self.height-8)
+        cr.rectangle(PADDING,PADDING,self.width-2*PADDING,self.height-2*PADDING)
         cr.fill()
         cr.set_source_rgb(*self.fg)
-        cr.rectangle(4,4,self.width-8,self.height-8)
+        cr.rectangle(PADDING,PADDING,self.width-2*PADDING,self.height-2*PADDING)
         cr.stroke()

     def on_expose(self,widget,event):
ViewGit