From 3a971a6063eeab37101560392608a74e8eb4b319 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 18 Jan 2016 20:40:40 +0100 Subject: [PATCH] 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. --- src/generic/colrdlgg.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index f503201059..37beb296af 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -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)));