bigboard r7333 - trunk/bigboard/stocks/search



Author: otaylor
Date: Wed May  7 19:23:42 2008
New Revision: 7333
URL: http://svn.gnome.org/viewvc/bigboard?rev=7333&view=rev

Log:
use the same size for stock icons in search results as for other icons


Modified:
   trunk/bigboard/stocks/search/SearchStock.py

Modified: trunk/bigboard/stocks/search/SearchStock.py
==============================================================================
--- trunk/bigboard/stocks/search/SearchStock.py	(original)
+++ trunk/bigboard/stocks/search/SearchStock.py	Wed May  7 19:23:42 2008
@@ -18,6 +18,8 @@
         
 _logger = logging.getLogger("bigboard.stocks.SearchStock")
 
+_ICON_SIZE = 48
+
 class ThemedTextRenderer(gtk.CellRendererText):
     __gproperties__ = {
         'theme-part': (str, 'Theme Part', 'Part name to pass to theme engine', None, gobject.PARAM_READWRITE)
@@ -137,7 +139,6 @@
         
         self.__tm = ThemeManager.getInstance()
         
-        self.__icon_size = 48
         self.__view.insert_column_with_data_func(-1, '',
                                                  ThemedPixbufRenderer(),
                                                  self.__render_icon)
@@ -187,7 +188,7 @@
         if isinstance(pixbuf, gtk.gdk.Pixbuf):
             pass
         elif isinstance(pixbuf, basestring):
-            pixbuf = gtk.icon_theme_get_default().load_icon(pixbuf, 32, gtk.ICON_LOOKUP_USE_BUILTIN)
+            pixbuf = gtk.icon_theme_get_default().load_icon(pixbuf, _ICON_SIZE, gtk.ICON_LOOKUP_USE_BUILTIN)
         else:
             pixbuf = None
 
@@ -360,7 +361,7 @@
             icon = r.get_icon()
             icon_is_url = False
             if icon and icon.startswith(os.sep):
-                icon = gtk.gdk.pixbuf_new_from_file_at_size(icon, self.__icon_size, self.__icon_size)
+                icon = gtk.gdk.pixbuf_new_from_file_at_size(icon, _ICON_SIZE, _ICON_SIZE)
             icon_url = r.get_icon_url()
 
             end_of_heading = self.__find_insert_iter(heading)
@@ -402,7 +403,7 @@
         if not iter:
             _logger.debug("no result visible for %s", url)
             return
-        pixbuf = pixbuf.scale_simple(self.__icon_size, self.__icon_size, gtk.gdk.INTERP_BILINEAR)        
+        pixbuf = pixbuf.scale_simple(_ICON_SIZE, _ICON_SIZE, gtk.gdk.INTERP_BILINEAR)        
         self.__store.set(iter, 1, pixbuf)
         path = self.__store.get_path(iter)        
         self.__store.row_changed(path, iter)



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