Exemple #1
0
        public Pixbuf GetIcon(Icons.Icon icon, IconSize size)
        {
            Pixbuf pb;
            string iconKey = icon.Name + (int)size;

            if (iconCache.TryGetValue(iconKey, out pb))
                return pb;

            pb = icon.Render(widget, size);
            if (pb == null)
                return null;

            iconCache.Add(iconKey, pb);
            //Debug.WriteLine(string.Format("IconCache: cached icon \"{0}\" (size = {1})", icon.Name, IconUtils.GetIconSizeVal(size)));

            return pb;
        }