LEFT | RIGHT |
(Both sides are equal) |
1 # vim:set et sts=4 sw=4: | 1 # vim:set et sts=4 sw=4: |
2 # | 2 # |
3 # ibus - The Input Bus | 3 # ibus - The Input Bus |
4 # | 4 # |
5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com> | 5 # Copyright (c) 2007-2010 Peng Huang <shawn.p.huang@gmail.com> |
6 # Copyright (c) 2007-2010 Red Hat, Inc. | 6 # Copyright (c) 2007-2010 Red Hat, Inc. |
7 # | 7 # |
8 # This library is free software; you can redistribute it and/or | 8 # This library is free software; you can redistribute it and/or |
9 # modify it under the terms of the GNU Lesser General Public | 9 # modify it under the terms of the GNU Lesser General Public |
10 # License as published by the Free Software Foundation; either | 10 # License as published by the Free Software Foundation; either |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 width = pixbuf.get_width() | 40 width = pixbuf.get_width() |
41 height = pixbuf.get_height() | 41 height = pixbuf.get_height() |
42 scale = float(size) / float(max(width, height)) | 42 scale = float(size) / float(max(width, height)) |
43 width = int(scale * width) | 43 width = int(scale * width) |
44 height = int(scale * height) | 44 height = int(scale * height) |
45 pixbuf = pixbuf.scale_simple(width, height, gdk.INTERP_BILINEAR) | 45 pixbuf = pixbuf.scale_simple(width, height, gdk.INTERP_BILINEAR) |
46 | 46 |
47 self.set_from_pixbuf(pixbuf) | 47 self.set_from_pixbuf(pixbuf) |
48 self.show() | 48 self.show() |
LEFT | RIGHT |