Commit e60b7e7b authored by Jim Nelson's avatar Jim Nelson

#1054: Direct-load icons need to be copied now if they're to be modified...

#1054: Direct-load icons need to be copied now if they're to be modified (which the histogram control does to 
theme the nubs).
parent 5613d337
......@@ -107,7 +107,7 @@ public class ThemeLoader {
public static Gdk.Pixbuf load_icon(string source_basename) {
Gdk.Pixbuf loaded_pixbuf = Resources.get_icon(source_basename, 0);
Gdk.Pixbuf loaded_pixbuf = Resources.get_icon(source_basename, 0).copy();
/* Sweep through the icon image data loaded from disk and determine how many
unique colors are in it. We do this with the aid of a HashSet. */
......@@ -168,6 +168,8 @@ along with Shotwell; if not, write to the Free Software Foundation, Inc.,
return AppDirs.get_resources_dir().get_child("ui").get_child(filename);
// This method returns a reference to a cached pixbuf that may be shared throughout the system.
// If the pixbuf is to be modified, make a copy of it.
public Gdk.Pixbuf? get_icon(string name, int scale = DEFAULT_ICON_SCALE) {
// stash icons not available through the UI Manager (i.e. used directly as pixbufs)
// in the local cache
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