Example #1
0
 private void UpdateItemSize(DarkListItem item)
 {
     using (var g = CreateGraphics())
     {
         UpdateItemSize(item, g);
     }
 }
Example #2
0
        private void UpdateItemSize(DarkListItem item, Graphics g)
        {
            var size = g.MeasureString(item.Text, Font);

            size.Width++;

            if (ShowIcons)
            {
                size.Width += _iconSize + 8;
            }

            item.Area = new Rectangle(item.Area.Left, item.Area.Top, (int)size.Width, item.Area.Height);
        }
Example #3
0
        private void UpdateContentSize(DarkListItem item)
        {
            var itemWidth = item.Area.Right + 1;

            if (itemWidth == ContentSize.Width)
            {
                UpdateContentSize();
                return;
            }

            if (itemWidth > ContentSize.Width)
            {
                ContentSize = new Size(itemWidth, ContentSize.Height);
                Invalidate();
            }
        }
Example #4
0
 private void UpdateItemPosition(DarkListItem item, int index)
 {
     item.Area = new Rectangle(2, (index * ItemHeight), item.Area.Width, ItemHeight);
 }
Example #5
0
 public int GetItemIndex(DarkListItem item)
 {
     return(Items.IndexOf(item));
 }