From c4c406dce0cb09c2cc6e82dbcaa9ab1b4c318b18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Tue, 8 Jan 2013 16:12:21 -0300
Subject: [PATCH toolkit 2/2] IconEntry: Workaround for incorrect icon size -
SL #3569 - #3385
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
---
src/sugar3/graphics/iconentry.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/sugar3/graphics/iconentry.py b/src/sugar3/graphics/iconentry.py
index f4e5682..5c67a62 100644
a
|
b
|
from sugar3.graphics.icon import _SVGLoader |
28 | 28 | ICON_ENTRY_PRIMARY = Gtk.EntryIconPosition.PRIMARY |
29 | 29 | ICON_ENTRY_SECONDARY = Gtk.EntryIconPosition.SECONDARY |
30 | 30 | |
| 31 | ENTRY_ICON_SIZE = style.zoom(22) |
31 | 32 | |
32 | 33 | class IconEntry(Gtk.Entry): |
33 | 34 | |
… |
… |
class IconEntry(Gtk.Entry): |
63 | 64 | def set_icon(self, position, pixbuf): |
64 | 65 | if type(pixbuf) is not GdkPixbuf.Pixbuf: |
65 | 66 | raise ValueError('Argument must be a pixbuf, not %r.' % pixbuf) |
| 67 | |
| 68 | # Workaround, GTK+ is not scaling some icons correctly. See |
| 69 | # tickets #3569 and #3385 . |
| 70 | if (pixbuf.props.width is not ENTRY_ICON_SIZE or |
| 71 | pixbuf.props.height is not ENTRY_ICON_SIZE): |
| 72 | pixbuf = pixbuf.scale_simple(ENTRY_ICON_SIZE, |
| 73 | ENTRY_ICON_SIZE, |
| 74 | GdkPixbuf.InterpType.BILINEAR) |
| 75 | |
66 | 76 | self.set_icon_from_pixbuf(position, pixbuf) |
67 | 77 | |
68 | 78 | def remove_icon(self, position): |