Fix toolbar icon size in GTK+ 3.14: Bug #732065

By setting the icon pixel size, that forces GTK+ to load images
installed in our locations rather than the theme's.
This commit is contained in:
Matthias Clasen 2014-09-25 16:46:59 -07:00 committed by Jim Nelson
parent 1dbd8affd5
commit f1fc86f2db
2 changed files with 8 additions and 1 deletions

1
THANKS
View file

@ -5,6 +5,7 @@ Jürg Billeter <j@bitron.ch>
Yosef Or Boczko <yoseforb@gmail.com>
Martijn Braam <pizzamartijn@gmail.com>
Attila Bukor <r1pp3rj4ck@w4it.eu>
Matthias Clasen <mclasen@redhat.com>
Andrea Corbellini <corbellini.andrea@gmail.com>
Sergey Shnatsel Davidoff <sergey@elementaryos.org>
Joanmarie Diggs <jdiggs@igalia.com>

View file

@ -38,8 +38,14 @@ public interface PillBar : Gtk.Container {
b.related_action = action_group.get_action(action_name);
b.tooltip_text = b.related_action.tooltip;
b.related_action.notify["tooltip"].connect(() => { b.tooltip_text = b.related_action.tooltip; });
b.image = new Gtk.Image.from_icon_name(icon_name != null ? icon_name :
// set pixel size to force GTK+ to load our images from our installed directory, not the theme
// directory
Gtk.Image image = new Gtk.Image.from_icon_name(icon_name != null ? icon_name :
b.related_action.icon_name, Gtk.IconSize.MENU);
image.set_pixel_size(16);
b.image = image;
// Unity buttons are a bit tight
#if ENABLE_UNITY
b.image.margin = b.image.margin + 4;