Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
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
parentf41be2235992a8a5d26955a9af3bc4f5679c1394 (diff)
Fix ImageButton paint background
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r--Mini/miniTamTamMain.py6
-rw-r--r--common/Util/ThemeWidgets.py11
2 files changed, 5 insertions, 12 deletions
diff --git a/Mini/miniTamTamMain.py b/Mini/miniTamTamMain.py
index cf50cae..fdea995 100644
--- a/Mini/miniTamTamMain.py
+++ b/Mini/miniTamTamMain.py
@@ -298,9 +298,9 @@ class miniTamTamMain(Gtk.HBox):
drum_group = drum
drum_i += 1
- self.rightBox.pack_start(slidersBox, False, True, 0)
- self.rightBox.pack_start(generateBtnSub, False, True, 0)
- self.rightBox.pack_start(drum_scroll, True, True, 0)
+ self.rightBox.pack_start(slidersBox, True, True, 0)
+ self.rightBox.pack_start(generateBtnSub, True, True, 0)
+ self.rightBox.pack_start(drum_scroll, False, True, 0)
drum_size = drum_group.get_size_request()
slidersBox.set_size_request(-1, int(drum_size[1] * 2.3))
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()