[pitivi: 2/41] Enforce showing icons in the play/pause button



commit 80df43d065b2d4ae762796826c7d75372bc7c781
Author: Jean-FranÃois Fortin Tam <nekohayo gmail com>
Date:   Fri Jul 15 00:57:50 2011 -0400

    Enforce showing icons in the play/pause button

 pitivi/ui/viewer.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/ui/viewer.py b/pitivi/ui/viewer.py
index ae17d17..f56b6db 100644
--- a/pitivi/ui/viewer.py
+++ b/pitivi/ui/viewer.py
@@ -642,8 +642,10 @@ class PlayPauseButton(gtk.Button, Loggable):
         }
 
     def __init__(self):
-        gtk.Button.__init__(self, label="")
+        gtk.Button.__init__(self)
         Loggable.__init__(self)
+        self.image = gtk.Image()
+        self.add(self.image)
         self.playing = True
         self.setPlay()
         self.connect('clicked', self._clickedCb)
@@ -658,7 +660,7 @@ class PlayPauseButton(gtk.Button, Loggable):
         """ display the play image """
         self.log("setPlay")
         if self.playing:
-            self.set_image(gtk.image_new_from_stock(gtk.STOCK_MEDIA_PLAY, gtk.ICON_SIZE_BUTTON))
+            self.image.set_from_stock(gtk.STOCK_MEDIA_PLAY, gtk.ICON_SIZE_BUTTON)
             self.set_tooltip_text(_("Play"))
             self.playing = False
 
@@ -666,6 +668,6 @@ class PlayPauseButton(gtk.Button, Loggable):
         self.log("setPause")
         """ display the pause image """
         if not self.playing:
-            self.set_image(gtk.image_new_from_stock(gtk.STOCK_MEDIA_PAUSE, gtk.ICON_SIZE_BUTTON))
+            self.image.set_from_stock(gtk.STOCK_MEDIA_PAUSE, gtk.ICON_SIZE_BUTTON)
             self.set_tooltip_text(_("Pause"))
             self.playing = True



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]