From ed8ac7059c65bf60f9fff07f7a3a209168273faf Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Jul 2018 16:50:10 +0200 Subject: [PATCH] Use more descriptive symbolic constants in wxSearchCtrl code Replace LIGHT_STEP macro and 20 magic number with SEARCH_BITMAP_LIGHTNESS and CANCEL_BITMAP_LIGHTNESS constants which are a bit more clear, hopefully. No real changes. --- src/generic/srchctlg.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index c9ea71e5d2..9482c1e3c1 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -37,7 +37,10 @@ // the margin between the text control and the search/cancel buttons static const wxCoord MARGIN = 2; -#define LIGHT_STEP 160 +// arguments to wxColour::ChangeLightness() for making the search/cancel +// bitmaps foreground colour, respectively +static const int SEARCH_BITMAP_LIGHTNESS = 140; // slightly lighter +static const int CANCEL_BITMAP_LIGHTNESS = 160; // a bit more lighter // ---------------------------------------------------------------------------- // wxSearchTextCtrl: text control used by search control @@ -952,7 +955,7 @@ static void RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded) wxBitmap wxSearchCtrl::RenderSearchBitmap( int x, int y, bool renderDrop ) { wxColour bg = GetBackgroundColour(); - wxColour fg = GetForegroundColour().ChangeLightness(LIGHT_STEP-20); + wxColour fg = GetForegroundColour().ChangeLightness(SEARCH_BITMAP_LIGHTNESS); //=============================================================================== // begin drawing code @@ -1055,7 +1058,7 @@ wxBitmap wxSearchCtrl::RenderSearchBitmap( int x, int y, bool renderDrop ) wxBitmap wxSearchCtrl::RenderCancelBitmap( int x, int y ) { wxColour bg = GetBackgroundColour(); - wxColour fg = GetForegroundColour().ChangeLightness(LIGHT_STEP); + wxColour fg = GetForegroundColour().ChangeLightness(CANCEL_BITMAP_LIGHTNESS); //=============================================================================== // begin drawing code