From 62aeeb75e36b742cccf45a3cb75d8dcd0acd0802 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Sat, 1 Sep 2018 11:10:09 +0200 Subject: [PATCH] Use icon factory to get binary filename open icon issue7662 review53351002 --- tryton/gui/window/view_form/view/form_gtk/binary.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/binary.py b/tryton/gui/window/view_form/view/form_gtk/binary.py index 0b15ced810..fd4d72e05b 100644 --- a/tryton/gui/window/view_form/view/form_gtk/binary.py +++ b/tryton/gui/window/view_form/view/form_gtk/binary.py @@ -200,11 +200,16 @@ class Binary(BinaryMixin, Widget): self.wid_text.set_text(self.filename_field.get(record) or '') reset_position(self.wid_text) if size: - stock, tooltip = 'tryton-open', _("Open...") + icon, tooltip = 'tryton-open', _("Open...") else: - stock, tooltip = None, '' + icon, tooltip = None, '' pos = gtk.ENTRY_ICON_PRIMARY - self.wid_text.set_icon_from_stock(pos, stock) + if icon: + pixbuf = common.IconFactory.get_pixbuf( + icon, gtk.ICON_SIZE_MENU) + else: + pixbuf = None + self.wid_text.set_icon_from_pixbuf(pos, pixbuf) self.wid_text.set_icon_tooltip_text(pos, tooltip) self.update_buttons(bool(size)) return True