예제 #1
0
 private void UpdateItemSize(DarkListItem item)
 {
     using (var g = CreateGraphics())
     {
         UpdateItemSize(item, g);
     }
 }
예제 #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);
        }
예제 #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();
            }
        }
예제 #4
0
 private void UpdateItemPosition(DarkListItem item, int index)
 {
     item.Area = new Rectangle(2, (index * ItemHeight), item.Area.Width, ItemHeight);
 }
예제 #5
0
 public int GetItemIndex(DarkListItem item)
 {
     return(Items.IndexOf(item));
 }