32 lines
656 B
C#
32 lines
656 B
C#
using System;
|
|
using Ext.SilentorBit;
|
|
using System.IO;
|
|
|
|
namespace SpritePacker.GUI
|
|
{
|
|
public class SpriteListView : ListView<Sprite>
|
|
{
|
|
public SpriteListView() : base("#", "Filename", "Image Size")
|
|
{
|
|
}
|
|
|
|
protected override void RenderCell(Gtk.CellRendererText render, int index, Sprite sprite)
|
|
{
|
|
switch(index)
|
|
{
|
|
case 0:
|
|
render.Text = index.ToString();
|
|
break;
|
|
case 1:
|
|
render.Text = System.IO.Path.GetFileName(sprite.Filename);
|
|
break;
|
|
case 2:
|
|
render.Text = $"{sprite.Width} x {sprite.Height}";
|
|
break;
|
|
default:
|
|
throw new InvalidDataException($"Invalid column index {index}");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|