예제 #1
0
파일: ItemView.cs 프로젝트: balihb/basenji
        private Gdk.Pixbuf GetImage(VolumeItem item)
        {
            Gdk.Pixbuf img = null;

            if (App.Settings.ShowThumbsInItemLists)
            {
                int sz = IconUtils.GetIconSizeVal(ICON_SIZE);
                img = PathUtil.GetThumb(item, database, sz);
            }

            if (img == null)
            {
                img = itemIcons.GetIconForItem(item, ICON_SIZE);
            }

            return(img);
        }
예제 #2
0
        public void Preview(VolumeItem item, VolumeDatabase db)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            // free old pixbuf (but not a _cached_ icon!)
            if (!isIcon && (this.pb != null))
            {
                this.pb.Dispose();
                this.pb = null;
            }

            Pixbuf tmp = PathUtil.GetThumb(item, db, 0);

            if (tmp != null)
            {
                this.pb     = tmp;
                this.isIcon = false;
            }
            else
            {
                if (EnableGenericIcons)
                {
                    this.pb = itemIcons.GetIconForItem(item, ICON_SIZE);
                }
                else
                {
                    this.pb = null;
                }
                this.isIcon = true;
            }

            QueueDraw();
        }