Use dialog background colour to draw rectangle when removing highlight from colour item.

Use neutral dialog background colour to overpaint rectangle used to highlight colour item in generic colour dialog.
This commit is contained in:
Artur Wieczorek 2016-01-18 20:40:40 +01:00
parent 600bfed6c5
commit 3a971a6063

View File

@ -506,6 +506,10 @@ void wxGenericColourDialog::PaintHighlight(wxDC& dc, bool draw)
int deltaX = 2;
int deltaY = 2;
// Frame for highlighted element is black.
// Frame is removed by drawing in dialog background colour.
wxPen pen(draw ? *wxBLACK_PEN : wxPen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)));
if (m_whichKind == 1)
{
// Standard colours
@ -515,10 +519,7 @@ void wxGenericColourDialog::PaintHighlight(wxDC& dc, bool draw)
x = (x*(m_smallRectangleSize.x + m_gridSpacing) + m_standardColoursRect.x) - deltaX;
y = (y*(m_smallRectangleSize.y + m_gridSpacing) + m_standardColoursRect.y) - deltaY;
if (draw)
dc.SetPen(*wxBLACK_PEN);
else
dc.SetPen(*wxLIGHT_GREY_PEN);
dc.SetPen(pen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle( x, y, (m_smallRectangleSize.x + (2*deltaX)), (m_smallRectangleSize.y + (2*deltaY)));
@ -532,10 +533,7 @@ void wxGenericColourDialog::PaintHighlight(wxDC& dc, bool draw)
x = (x*(m_smallRectangleSize.x + m_gridSpacing) + m_customColoursRect.x) - deltaX;
y = (y*(m_smallRectangleSize.y + m_gridSpacing) + m_customColoursRect.y) - deltaY;
if (draw)
dc.SetPen(*wxBLACK_PEN);
else
dc.SetPen(*wxLIGHT_GREY_PEN);
dc.SetPen(pen);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawRectangle( x, y, (m_smallRectangleSize.x + (2*deltaX)), (m_smallRectangleSize.y + (2*deltaY)));