Refactoring for Find dlg Status messge color

This commit is contained in:
Don Ho 2024-08-31 15:00:11 +02:00
parent 22c03102f2
commit 21e5350f90
3 changed files with 24 additions and 8 deletions

View File

@ -4953,20 +4953,20 @@ void FindReplaceDlg::combo2ExtendedMode(int comboID)
void FindReplaceDlg::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
//printStr(L"OK"));
COLORREF fgColor = RGB(0, 0, 0); // black by default
COLORREF fgColor = black; // black by default
PCTSTR ptStr =(PCTSTR)lpDrawItemStruct->itemData;
if (_statusbarFindStatus == FSNotFound)
{
fgColor = RGB(0xFF, 00, 00); // red
fgColor = _FSNotFoundTextColor;
}
else if (_statusbarFindStatus == FSMessage)
{
fgColor = RGB(0, 0, 0xFF); // blue
fgColor = _FSMessageTextColor;
}
else if (_statusbarFindStatus == FSTopReached || _statusbarFindStatus == FSEndReached)
{
fgColor = RGB(0, 166, 0); // green
fgColor = _FSReachedTextColor;
}
else if (_statusbarFindStatus == FSNoMessage)
{
@ -4979,15 +4979,27 @@ void FindReplaceDlg::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
if (_statusbarFindStatus == FSNotFound)
{
fgColor = RGB(0xFF, 0x50, 0x50); // red
HLSColour hls;
hls.changeHLSFrom(_FSNotFoundTextColor);
hls._lightness += 50;
hls._saturation -= 20;
fgColor = hls.toRGB(); // red
}
else if (_statusbarFindStatus == FSMessage)
{
fgColor = RGB(0x70, 0x70, 0xFF); // blue
HLSColour hls;
hls.changeHLSFrom(_FSMessageTextColor);
hls._lightness += 50;
hls._saturation -= 20;
fgColor = hls.toRGB(); // blue
}
else if (_statusbarFindStatus == FSTopReached || _statusbarFindStatus == FSEndReached)
{
fgColor = RGB(0x50, 0xFF, 0x50); // green
HLSColour hls;
hls.changeHLSFrom(_FSReachedTextColor);
hls._lightness += 50;
hls._saturation -= 20;
fgColor = hls.toRGB(); // green
}
}

View File

@ -499,7 +499,12 @@ private:
static const int FR_OP_GLOBAL = 8;
static const int FR_OP_FIP = 16;
void saveInMacro(size_t cmd, int cmdType);
COLORREF _FSNotFoundTextColor = red;
COLORREF _FSMessageTextColor = blue;
COLORREF _FSReachedTextColor = darkGreen;
void drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
bool replaceInFilesConfirmCheck(const std::wstring& directory, const std::wstring& fileTypes);
bool replaceInProjectsConfirmCheck();
bool replaceInOpenDocsConfirmCheck(void);

View File

@ -39,7 +39,6 @@ const COLORREF grey = RGB(128, 128, 128);
const COLORREF liteGrey = RGB(192, 192, 192);
const COLORREF veryLiteGrey = RGB(224, 224, 224);
const COLORREF brown = RGB(128, 64, 0);
//const COLORREF greenBlue = RGB(192, 128, 64);
const COLORREF darkYellow = RGB(0xFF, 0xC0, 0);
const COLORREF yellow = RGB(0xFF, 0xFF, 0);
const COLORREF lightYellow = RGB(0xFF, 0xFF, 0xD5);