Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-01-21 18:42:29 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-01-21 18:42:29 (GMT)
commitcfe53edcbb14c074dc49cd7402ea8191055dd479 (patch)
tree9e1036bee682990cd033514d7c3ef31aa0ee09d2 /common
parentf41be2235992a8a5d26955a9af3bc4f5679c1394 (diff)
Fix ImageButton paint background
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'common')
-rw-r--r--common/Util/ThemeWidgets.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/common/Util/ThemeWidgets.py b/common/Util/ThemeWidgets.py
index 018c558..0d19f11 100644
--- a/common/Util/ThemeWidgets.py
+++ b/common/Util/ThemeWidgets.py
@@ -704,17 +704,10 @@ class ImageButton(Gtk.Button):
self.down = False
self.connect('draw', self.draw)
- self.connect('size-allocate', self.size_allocate)
-
-
- def size_allocate(self, widget, allocation):
- self.alloc = allocation
- self.drawX = allocation.x + allocation.width//2
- self.drawY = allocation.y + allocation.height//2
def draw(self, widget, cr):
- cr.rectangle(0, 0, 100, 100)
- cr.fill()
+ alloc = self.get_allocation()
+ cr.rectangle(0, 0, alloc.width, alloc.height)
if self.is_png:
cr.set_source_surface(self.image[self.curImage], 0, 0)
cr.paint()