From cfe53edcbb14c074dc49cd7402ea8191055dd479 Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Mon, 21 Jan 2013 18:42:29 +0000 Subject: Fix ImageButton paint background Signed-off-by: Gonzalo Odiard --- 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() -- cgit v0.9.1