diff options
-rwxr-xr-x | gui.py | 25 | ||||
-rw-r--r-- | iw/progress_gui.py | 2 |
2 files changed, 18 insertions, 9 deletions
@@ -1180,7 +1180,7 @@ class InstallControlState: return fn return None - def readPixmap (self, file): + def readPixmap (self, file, height = None, width = None): fn = self.findPixmap(file) if not fn: log("unable to load %s", file) @@ -1190,13 +1190,22 @@ class InstallControlState: except RuntimeError, msg: log("unable to read %s: %s", file, msg) return None - source = gtk.IconSource() - source.set_pixbuf(pixbuf) - source.set_size(gtk.ICON_SIZE_DIALOG) - source.set_size_wildcarded(gtk.FALSE) - iconset = gtk.IconSet() - iconset.add_source(source) - p = gtk.image_new_from_icon_set(iconset, gtk.ICON_SIZE_DIALOG) + curheight = pixbuf.get_height() + curwidth = pixbuf.get_width() + if (height is not None and width is not None + and height != curheight and width != curwidth): + sclpix = pixbuf.scale_simple(height, width, + gtk.gdk.INTERP_BILINEAR) + p = gtk.Image() + p.set_from_pixbuf(sclpix) + else: + source = gtk.IconSource() + source.set_pixbuf(pixbuf) + source.set_size(gtk.ICON_SIZE_DIALOG) + source.set_size_wildcarded(gtk.FALSE) + iconset = gtk.IconSet() + iconset.add_source(source) + p = gtk.image_new_from_icon_set(iconset, gtk.ICON_SIZE_DIALOG) return p def readHTML (self, file): diff --git a/iw/progress_gui.py b/iw/progress_gui.py index c43dea76b..ec471d3d7 100644 --- a/iw/progress_gui.py +++ b/iw/progress_gui.py @@ -117,7 +117,7 @@ class InstallProgressWindow (InstallWindow): num = self.pixcurnum + 1 if num >= len(self.pixmaps): num = min(1, len(self.pixmaps)) - pix = self.ics.readPixmap (self.pixmaps[num]) + pix = self.ics.readPixmap (self.pixmaps[num], 425, 225) if pix: if self.adpix: self.adbox.remove (self.adpix) |