diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-08-14 06:01:18 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-08-14 06:01:18 +0000 |
commit | 633deebaa2fb250a032abca252b906489a90fd36 (patch) | |
tree | b956bd0b1c4b47e2033914236e63eb3683793a6a | |
parent | febf4c25c6f280167369f4f9e5c4bbac1eb979c6 (diff) | |
download | anaconda-633deebaa2fb250a032abca252b906489a90fd36.tar.gz anaconda-633deebaa2fb250a032abca252b906489a90fd36.tar.xz anaconda-633deebaa2fb250a032abca252b906489a90fd36.zip |
scale images to 425x225 if they're not that size for the ransom notes
-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) |