Skip to content

Commit

Permalink
Merge pull request #228 from peymanr34/no-prefix
Browse files Browse the repository at this point in the history
Add NoPrefix flag to renderers.
  • Loading branch information
oozcitak authored May 10, 2021
2 parents 789bca8 + 54ab9c6 commit 4ca2d48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ImageListView/ImageListViewRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ public virtual void DrawItem(Graphics g, ImageListViewItem item, ItemState state
Size szt = TextRenderer.MeasureText(item.Text, ImageListView.Font);
Rectangle rt = new Rectangle(bounds.Left + itemPadding.Width, bounds.Top + 2 * itemPadding.Height + ImageListView.ThumbnailSize.Height, ImageListView.ThumbnailSize.Width, szt.Height);
TextRenderer.DrawText(g, item.Text, ImageListView.Font, rt, foreColor,
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine);
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.NoPrefix);
}
else // if (ImageListView.View == View.Details)
{
Expand Down
8 changes: 4 additions & 4 deletions ImageListView/ImageListViewRenderers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@ public override void DrawItem(Graphics g, ImageListViewItem item, ItemState stat
bounds.Left + itemPadding.Width, bounds.Top + 2 * itemPadding.Height + ImageListView.ThumbnailSize.Height,
ImageListView.ThumbnailSize.Width, szt.Height);
TextRenderer.DrawText(g, item.Text, ImageListView.Font, rt, foreColor,
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping);
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPrefix);
}
else // if (ImageListView.View == View.Details)
{
Expand Down Expand Up @@ -2599,7 +2599,7 @@ public override void DrawItem(Graphics g, ImageListViewItem item, ItemState stat
}
else
TextRenderer.DrawText(g, item.SubItems[column].Text, ImageListView.Font, rt, foreColor,
TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping);
TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPrefix);

rt.X -= iconOffset;
}
Expand Down Expand Up @@ -2927,7 +2927,7 @@ public override void DrawItem(Graphics g, ImageListViewItem item, ItemState stat
}
else
TextRenderer.DrawText(g, item.SubItems[column].Text, ImageListView.Font, rt, foreColor,
TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping);
TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPrefix);

rt.X -= iconOffset;
rt.X += column.Width;
Expand Down Expand Up @@ -3033,7 +3033,7 @@ public override void DrawItem(Graphics g, ImageListViewItem item, ItemState stat
else if (!ImageListView.Focused && (state & ItemState.Selected) != ItemState.None)
foreColor = ImageListView.Colors.UnFocusedForeColor;
TextRenderer.DrawText(g, item.Text, ImageListView.Font, textBounds, foreColor,
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping);
TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPrefix);

// Focus rectangle
if (ImageListView.Focused && ((state & ItemState.Focused) != ItemState.None))
Expand Down

0 comments on commit 4ca2d48

Please sign in to comment.