Skip to content

Commit

Permalink
Refactoring for Find dlg Status messge color
Browse files Browse the repository at this point in the history
  • Loading branch information
donho committed Aug 31, 2024
1 parent 22c0310 commit 21e5350
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
26 changes: 19 additions & 7 deletions PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
}
}

Expand Down
5 changes: 5 additions & 0 deletions PowerEditor/src/ScintillaComponent/FindReplaceDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,12 @@ protected :
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);
Expand Down
1 change: 0 additions & 1 deletion PowerEditor/src/ScintillaComponent/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 21e5350

Please sign in to comment.