Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ private void CalculatePageInfo()

private void DrawMessage(Graphics g, Rectangle rect, bool isExceptionPrinting)
{
Color brushColor = ShouldSerializeForeColor() ? ForeColor : SystemColors.ControlText;
Color brushColor = ForeColor;
Comment thread
ricardobossan marked this conversation as resolved.
Outdated
if (SystemInformation.HighContrast && Parent is Control parent)
{
brushColor = parent.BackColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@ public void ShowPrintPreviewControl_BackColorIsCorrect()
Assert.Equal(Color.Green.ToArgb(), actualBackColorArgb);
}

[Fact]
public void PrintPreviewControl_ForeColor_DefaultIsWhite()
{
PrintPreviewControl control = new();

Assert.Equal(Color.White.ToArgb(), control.ForeColor.ToArgb());
}

[Fact]
public void PrintPreviewControl_ForeColorWhite_ShouldSerializeReturnsFalse()
{
PrintPreviewControl control = new();

// White is the default, so ShouldSerializeForeColor should return false.
Assert.False(control.TestAccessor.Dynamic.ShouldSerializeForeColor());
}

[Fact]
public void PrintPreviewControl_ForeColorNonDefault_ShouldSerializeReturnsTrue()
{
PrintPreviewControl control = new();
Comment thread
ricardobossan marked this conversation as resolved.
Outdated
control.ForeColor = Color.Red;

Assert.True(control.TestAccessor.Dynamic.ShouldSerializeForeColor());
}

[Fact]
public void ShowPrintPreviewControlHighContrast_BackColorIsCorrect()
{
Expand Down
Loading