Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/button.py
diff options
context:
space:
mode:
authorerikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-10-19 01:40:26 (GMT)
committer erikb <erikb@574bc980-5f2d-0410-acbc-c8f9f0eb14e0>2007-10-19 01:40:26 (GMT)
commit7da326971358297236699864379e86d5c72f7ebc (patch)
treeee48af1f8c743d0b48ee68fd8babcf73f7c84105 /button.py
parent14e010ad53a9112e7125e62a8576cd57c1f14214 (diff)
buttons scale correctly throughout
git-svn-id: http://mediamods.com/public-svn/camera-activity/Record.activity@648 574bc980-5f2d-0410-acbc-c8f9f0eb14e0
Diffstat (limited to 'button.py')
-rw-r--r--button.py37
1 files changed, 15 insertions, 22 deletions
diff --git a/button.py b/button.py
index 8fef0c4..84f110c 100644
--- a/button.py
+++ b/button.py
@@ -23,50 +23,43 @@ class RecdButton(TrayButton, gobject.GObject):
def getImg( self ):
- #todo: remove mem refs
-
img = gtk.Image()
ipb = self.recd.getThumbPixbuf()
+ xoff = 0
+ yoff = 0
+ pb = None
if (self.recd.type == self.ui.ca.m.TYPE_PHOTO):
+ xoff = 8
+ yoff = 8
if (self.recd.buddy):
thumbPhotoSvg = self.ui.loadSvg(self.ui.thumbPhotoSvgData, self.recd.colorStroke.hex, self.recd.colorFill.hex)
pb = thumbPhotoSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 8, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
else:
pb = self.ui.thumbPhotoSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 8, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
- if (self.recd.type == self.ui.ca.m.TYPE_VIDEO):
+ elif (self.recd.type == self.ui.ca.m.TYPE_VIDEO):
+ xoff = 8
+ yoff = 22
if (self.recd.buddy):
thumbVideoSvg = self.ui.loadSvg(self.ui.thumbVideoSvgData, self.recd.colorStroke.hex, self.recd.colorFill.hex)
pb = thumbVideoSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 8, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
else:
pb = self.ui.thumbVideoSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 22, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
- if (self.recd.type == self.ui.ca.m.TYPE_AUDIO):
+ elif (self.recd.type == self.ui.ca.m.TYPE_AUDIO):
if (self.recd.buddy):
thumbAudioSvg = self.ui.loadSvg(self.ui.thumbAudioSvgData, self.recd.colorStroke.hex, self.recd.colorFill.hex)
pb = thumbAudioSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 8, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
else:
pb = self.ui.thumbVideoSvg.get_pixbuf()
- img.set_from_pixbuf( pb )
- img.show()
- ipb.composite(pb, 8, 22, ipb.get_width(), ipb.get_height(), 0, 0, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
+ img.set_from_pixbuf( pb )
+ img.show()
+ ipb.composite(pb, xoff, yoff, ipb.get_width(), ipb.get_height(), xoff, yoff, 1, 1, gtk.gdk.INTERP_BILINEAR, 255 )
img.set_from_pixbuf(pb)
+
+ gc.collect()
+
return img