Commit 9997d8e7 authored by Wolfgang Steitz's avatar Wolfgang Steitz Committed by Jim Nelson

Render symbolic icons gray (like Nautilus): Refs bgo#720771

This fixes most of the problems, but the icons in the toolbar
and the Inbox icon in the sidebar are still black.
parent 3ba75dac
......@@ -172,5 +172,22 @@ public class IconFactory {
// Default: missing image icon.
return get_missing_icon(size, flags);
}
public Gdk.Pixbuf? load_symbolic(string icon_name, int size, Gtk.StyleContext style,
Gtk.IconLookupFlags flags = 0) {
Gtk.IconInfo? icon_info = icon_theme.lookup_icon(icon_name, size, flags);
// Attempt to load as a symbolic icon.
if (icon_info != null) {
try {
return icon_info.load_symbolic_for_context(style);
} catch (Error e) {
message("Couldn't load icon: %s", e.message);
}
}
// Default: missing image icon.
return get_missing_icon(size, flags);
}
}
......@@ -203,7 +203,7 @@ public class ConversationWebView : WebKit.WebView {
try {
// Load icon.
uint8[]? icon_content = null;
Gdk.Pixbuf? pixbuf = IconFactory.instance.load_symbolic_colored(icon_name, 16);
Gdk.Pixbuf? pixbuf = IconFactory.instance.load_symbolic(icon_name, 16, get_style_context());
if (pixbuf != null)
pixbuf.save_to_buffer(out icon_content, "png"); // Load as PNG.
......
......@@ -799,11 +799,7 @@ public class Sidebar.Tree : Gtk.TreeView {
if (info == null)
return null;
// If the icon's symbolic, make it black.
Gdk.RGBA black = Gdk.RGBA();
black.red = black.green = black.blue = 0.0;
black.alpha = 1.0;
icon = info.load_symbolic(black);
icon = info.load_symbolic_for_context(get_style_context());
if (icon == null)
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment