mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 17:56:51 +13:00
Also move status indicator to bottom
This commit is contained in:
parent
b6daedf456
commit
b0933bbb88
2 changed files with 14 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,7 @@ public ThumbnailTitleLocation TitleLocation
|
|||
if (titleLocation != value)
|
||||
{
|
||||
titleLocation = value;
|
||||
pThumbnail.StatusLocation = value;
|
||||
UpdateLayout();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue