Also move status indicator to bottom

This commit is contained in:
Jaex 2019-09-03 13:56:49 +03:00
parent b6daedf456
commit b0933bbb88
2 changed files with 14 additions and 1 deletions

View file

@ -33,6 +33,7 @@ namespace ShareX
public class TaskRoundedCornerPanel : RoundedCornerPanel
{
public Color StatusColor { get; private set; } = Color.Transparent;
public ThumbnailTitleLocation StatusLocation { get; set; }
public void UpdateStatusColor(TaskStatus status)
{
@ -71,6 +72,17 @@ protected override void OnPaint(PaintEventArgs e)
g.PixelOffsetMode = PixelOffsetMode.Half;
int y;
if (StatusLocation == ThumbnailTitleLocation.Top)
{
y = 0;
}
else
{
y = ClientRectangle.Height;
}
using (LinearGradientBrush brush = new LinearGradientBrush(new Rectangle(0, 0, ClientRectangle.Width, 1), Color.Black, Color.Black,
LinearGradientMode.Horizontal))
{
@ -81,7 +93,7 @@ protected override void OnPaint(PaintEventArgs e)
using (Pen pen = new Pen(brush))
{
g.DrawLine(pen, new Point(0, 0), new Point(ClientRectangle.Width - 1, 0));
g.DrawLine(pen, new Point(0, y), new Point(ClientRectangle.Width - 1, y));
}
}
}

View file

@ -127,6 +127,7 @@ public ThumbnailTitleLocation TitleLocation
if (titleLocation != value)
{
titleLocation = value;
pThumbnail.StatusLocation = value;
UpdateLayout();
}
}