Use SystemColors in news list control

This commit is contained in:
Jaex 2018-06-06 17:49:51 +03:00
parent 86df4e4e85
commit d8008f993c
2 changed files with 8 additions and 4 deletions

View file

@ -34,6 +34,7 @@ private void InitializeComponent()
// tlpMain
//
this.tlpMain.AutoScroll = true;
this.tlpMain.BackColor = System.Drawing.SystemColors.Window;
this.tlpMain.ColumnCount = 2;
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));

View file

@ -127,11 +127,11 @@ private void TlpMain_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
if (e.Row.IsEvenNumber())
{
color = Color.FromArgb(250, 250, 250);
color = SystemColors.Window;
}
else
{
color = Color.FromArgb(247, 247, 247);
color = ColorHelpers.DarkerColor(SystemColors.Window, 0.02f);
}
using (Brush brush = new SolidBrush(color))
@ -144,7 +144,10 @@ private void TlpMain_CellPaint(object sender, TableLayoutCellPaintEventArgs e)
e.Graphics.FillRectangle(Brushes.LimeGreen, new Rectangle(e.CellBounds.X, e.CellBounds.Y, 5, e.CellBounds.Height));
}
e.Graphics.DrawLine(Pens.LightGray, new Point(e.CellBounds.X, e.CellBounds.Bottom - 1), new Point(e.CellBounds.Right - 1, e.CellBounds.Bottom - 1));
using (Pen pen = new Pen(ProfessionalColors.SeparatorDark))
{
e.Graphics.DrawLine(pen, new Point(e.CellBounds.X, e.CellBounds.Bottom - 1), new Point(e.CellBounds.Right - 1, e.CellBounds.Bottom - 1));
}
}
public void AddNewsItem(NewsItem item)
@ -199,7 +202,7 @@ public void AddNewsItem(NewsItem item)
{
tooltip.SetToolTip(lblText, item.URL);
lblText.Cursor = Cursors.Hand;
lblText.MouseEnter += (sender, e) => lblText.ForeColor = Color.Blue;
lblText.MouseEnter += (sender, e) => lblText.ForeColor = SystemColors.HotTrack;
lblText.MouseLeave += (sender, e) => lblText.ForeColor = SystemColors.ControlText;
lblText.MouseClick += (sender, e) =>
{