diff --git a/TBO/ApplicationLibrary.cs b/TBO/ApplicationLibrary.cs index 326e8fc..68c641e 100644 --- a/TBO/ApplicationLibrary.cs +++ b/TBO/ApplicationLibrary.cs @@ -73,10 +73,11 @@ string info = ltbo.Author; if (Library.ValidValue(ltbo.Publisher)) info = info + " (" + ltbo.Publisher + ")"; - Item i = new Item("tbo_" + idx++) { Image = ltbo.Image, Text = ltbo.DisplayName, Info = info, Count = ltbo.Year == 0 ? null : ltbo.Year.ToString(), Width = pLib.Width }; + Item i = new Item("tbo_" + idx) { Image = ltbo.Image, Text = ltbo.DisplayName, Info = info, Count = ltbo.Year == 0 ? null : ltbo.Year.ToString(), Width = pLib.Width, Top = idx * 51 }; pLib.Add(i); i.Tag = ltbo.FilePath; i.DoClick = itTBOClick; + idx++; } pLib.Invalidate(); } diff --git a/TBO/UI/tboTK/Item.cs b/TBO/UI/tboTK/Item.cs index 7b4b489..f491af9 100644 --- a/TBO/UI/tboTK/Item.cs +++ b/TBO/UI/tboTK/Item.cs @@ -1,4 +1,5 @@ using System.Drawing; +using System.Drawing.Drawing2D; using System.Drawing.Text; namespace TBO.UI.tboTK @@ -17,6 +18,8 @@ g.Clip = new Region(Bounds); g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit; g.FillRectangle(bg, Bounds); + GraphicsState gs = g.Save(); + g.TranslateTransform(Left, Top); if (Image != null) g.DrawImageKeepRatioEx(Image, 0, 0, Height, Height); SizeF stitle = g.MeasureString(Text, fnt); @@ -30,9 +33,10 @@ if (!string.IsNullOrEmpty(Count)) { SizeF scount = g.MeasureString(Count, fnt); - g.DrawString(Count, fnt, fgInfo, (Left+Width-scount.Width)-5, ((Height - stitle.Height) / 2) + 10); + g.DrawString(Count, fnt, fgInfo, (Left + Width - scount.Width) - 5, ((Height - stitle.Height) / 2) + 10); } + g.Restore(gs); } public string Text { get; set; }