Rename darkmode functions, variables

Rename darkmode functions, variables with name 'softer', 'pure' to 'ctrl', 'dlg'.

- remove unneeded `WM_ERASEBKGND` and check in some `WM_CTLCOLORSTATIC`
- fix wrongly used colors

ref https://github.com/notepad-plus-plus/notepad-plus-plus/pull/16350#issuecomment-2779111617

Close #16387
This commit is contained in:
ozone10 2025-04-05 17:34:25 +02:00 committed by Don Ho
parent 2a3152cd1a
commit f127ba02d0
36 changed files with 303 additions and 400 deletions

View File

@ -109,7 +109,7 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -119,7 +119,7 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -131,9 +131,9 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
//set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text
if (isStaticText)
{
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, nppParam.isAdmin());
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, nppParam.isAdmin());
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:

View File

@ -52,12 +52,10 @@ intptr_t CALLBACK HashFromFilesDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
const auto hdcStatic = reinterpret_cast<HDC>(wParam);
const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
@ -65,9 +63,7 @@ intptr_t CALLBACK HashFromFilesDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
}
break;
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -497,17 +493,15 @@ intptr_t CALLBACK HashFromTextDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
const auto hdcStatic = reinterpret_cast<HDC>(wParam);
const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
@ -515,9 +509,7 @@ intptr_t CALLBACK HashFromTextDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
}
break;
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:

View File

@ -142,7 +142,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL
::SetWindowPlacement(_hSelf,&posInfo);
if (NppDarkMode::isEnabled())
setStartupBgColor(NppDarkMode::getBackgroundColor()); //draw dark background when opening Npp without position data
setStartupBgColor(NppDarkMode::getDlgBackgroundColor()); //draw dark background when opening Npp without position data
}
if ((nppGUI._tabStatus & TAB_MULTILINE) != 0)
@ -193,7 +193,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL
}
if(cmdLineParams->isPointValid() && NppDarkMode::isEnabled())
setStartupBgColor(NppDarkMode::getBackgroundColor()); //draw dark background when opening Npp through cmd with position data
setStartupBgColor(NppDarkMode::getDlgBackgroundColor()); //draw dark background when opening Npp through cmd with position data
std::vector<wstring> fileNames;
std::vector<wstring> patterns;

View File

@ -297,9 +297,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (NppDarkMode::isEnabled())
{
RECT rc = {};
RECT rc{};
GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return 0;
}
else
@ -2032,7 +2032,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
roundCornerValue = 5;
}
::FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getDlgBackgroundBrush());
lr |= CDRF_NOTIFYITEMDRAW;
}
@ -2047,7 +2047,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
nmtbcd->clrText = NppDarkMode::getTextColor();
nmtbcd->clrTextHighlight = NppDarkMode::getTextColor();
nmtbcd->clrBtnFace = NppDarkMode::getBackgroundColor();
nmtbcd->clrBtnHighlight = NppDarkMode::getSofterBackgroundColor();
nmtbcd->clrBtnHighlight = NppDarkMode::getCtrlBackgroundColor();
nmtbcd->clrHighlightHotTrack = NppDarkMode::getHotBackgroundColor();
nmtbcd->nStringBkMode = TRANSPARENT;
nmtbcd->nHLStringBkMode = TRANSPARENT;
@ -2087,7 +2087,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
else if ((nmtbcd->nmcd.uItemState & CDIS_CHECKED) == CDIS_CHECKED)
{
auto holdBrush = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getSofterBackgroundBrush());
auto holdBrush = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getCtrlBackgroundBrush());
auto holdPen = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getEdgePen());
::RoundRect(nmtbcd->nmcd.hdc, rcItem.left, rcItem.top, rcItem.right, rcItem.bottom, roundCornerValue, roundCornerValue);
@ -3501,9 +3501,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (currentColors != NULL)
{
currentColors->background = NppDarkMode::getBackgroundColor();
currentColors->softerBackground = NppDarkMode::getSofterBackgroundColor();
currentColors->softerBackground = NppDarkMode::getCtrlBackgroundColor();
currentColors->hotBackground = NppDarkMode::getHotBackgroundColor();
currentColors->pureBackground = NppDarkMode::getDarkerBackgroundColor();
currentColors->pureBackground = NppDarkMode::getDlgBackgroundColor();
currentColors->errorBackground = NppDarkMode::getErrorBackgroundColor();
currentColors->text = NppDarkMode::getTextColor();
currentColors->darkerText = NppDarkMode::getDarkerTextColor();

View File

@ -89,9 +89,9 @@ namespace NppDarkMode
struct Brushes
{
HBRUSH background = nullptr;
HBRUSH softerBackground = nullptr;
HBRUSH ctrlBackground = nullptr;
HBRUSH hotBackground = nullptr;
HBRUSH pureBackground = nullptr;
HBRUSH dlgBackground = nullptr;
HBRUSH errorBackground = nullptr;
HBRUSH edgeBrush = nullptr;
@ -100,9 +100,9 @@ namespace NppDarkMode
Brushes(const Colors& colors)
: background(::CreateSolidBrush(colors.background))
, softerBackground(::CreateSolidBrush(colors.softerBackground))
, ctrlBackground(::CreateSolidBrush(colors.softerBackground))
, hotBackground(::CreateSolidBrush(colors.hotBackground))
, pureBackground(::CreateSolidBrush(colors.pureBackground))
, dlgBackground(::CreateSolidBrush(colors.pureBackground))
, errorBackground(::CreateSolidBrush(colors.errorBackground))
, edgeBrush(::CreateSolidBrush(colors.edge))
@ -113,9 +113,9 @@ namespace NppDarkMode
~Brushes()
{
::DeleteObject(background); background = nullptr;
::DeleteObject(softerBackground); softerBackground = nullptr;
::DeleteObject(ctrlBackground); ctrlBackground = nullptr;
::DeleteObject(hotBackground); hotBackground = nullptr;
::DeleteObject(pureBackground); pureBackground = nullptr;
::DeleteObject(dlgBackground); dlgBackground = nullptr;
::DeleteObject(errorBackground); errorBackground = nullptr;
::DeleteObject(edgeBrush); edgeBrush = nullptr;
@ -126,9 +126,9 @@ namespace NppDarkMode
void change(const Colors& colors)
{
::DeleteObject(background);
::DeleteObject(softerBackground);
::DeleteObject(ctrlBackground);
::DeleteObject(hotBackground);
::DeleteObject(pureBackground);
::DeleteObject(dlgBackground);
::DeleteObject(errorBackground);
::DeleteObject(edgeBrush);
@ -136,9 +136,9 @@ namespace NppDarkMode
::DeleteObject(disabledEdgeBrush);
background = ::CreateSolidBrush(colors.background);
softerBackground = ::CreateSolidBrush(colors.softerBackground);
ctrlBackground = ::CreateSolidBrush(colors.softerBackground);
hotBackground = ::CreateSolidBrush(colors.hotBackground);
pureBackground = ::CreateSolidBrush(colors.pureBackground);
dlgBackground = ::CreateSolidBrush(colors.pureBackground);
errorBackground = ::CreateSolidBrush(colors.errorBackground);
edgeBrush = ::CreateSolidBrush(colors.edge);
@ -621,9 +621,9 @@ namespace NppDarkMode
}
COLORREF getBackgroundColor() { return getTheme()._colors.background; }
COLORREF getSofterBackgroundColor() { return getTheme()._colors.softerBackground; }
COLORREF getCtrlBackgroundColor() { return getTheme()._colors.softerBackground; }
COLORREF getHotBackgroundColor() { return getTheme()._colors.hotBackground; }
COLORREF getDarkerBackgroundColor() { return getTheme()._colors.pureBackground; }
COLORREF getDlgBackgroundColor() { return getTheme()._colors.pureBackground; }
COLORREF getErrorBackgroundColor() { return getTheme()._colors.errorBackground; }
COLORREF getTextColor() { return getTheme()._colors.text; }
COLORREF getDarkerTextColor() { return getTheme()._colors.darkerText; }
@ -634,9 +634,9 @@ namespace NppDarkMode
COLORREF getDisabledEdgeColor() { return getTheme()._colors.disabledEdge; }
HBRUSH getBackgroundBrush() { return getTheme()._brushes.background; }
HBRUSH getSofterBackgroundBrush() { return getTheme()._brushes.softerBackground; }
HBRUSH getCtrlBackgroundBrush() { return getTheme()._brushes.ctrlBackground; }
HBRUSH getHotBackgroundBrush() { return getTheme()._brushes.hotBackground; }
HBRUSH getDarkerBackgroundBrush() { return getTheme()._brushes.pureBackground; }
HBRUSH getDlgBackgroundBrush() { return getTheme()._brushes.dlgBackground; }
HBRUSH getErrorBackgroundBrush() { return getTheme()._brushes.errorBackground; }
HBRUSH getEdgeBrush() { return getTheme()._brushes.edgeBrush; }
@ -655,7 +655,7 @@ namespace NppDarkMode
getTheme().change(clrs);
}
void setSofterBackgroundColor(COLORREF c)
void setCtrlBackgroundColor(COLORREF c)
{
Colors clrs = getTheme()._colors;
clrs.softerBackground = c;
@ -669,7 +669,7 @@ namespace NppDarkMode
getTheme().change(clrs);
}
void setDarkerBackgroundColor(COLORREF c)
void setDlgBackgroundColor(COLORREF c)
{
Colors clrs = getTheme()._colors;
clrs.pureBackground = c;
@ -831,7 +831,7 @@ namespace NppDarkMode
rc.top -= 1;
}
FillRect(pUDM->hdc, &rc, NppDarkMode::getDarkerBackgroundBrush());
FillRect(pUDM->hdc, &rc, NppDarkMode::getDlgBackgroundBrush());
*lr = 0;
@ -901,7 +901,7 @@ namespace NppDarkMode
case MBI_NORMAL:
case MBI_DISABLED:
{
::FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::getDlgBackgroundBrush());
break;
}
@ -915,7 +915,7 @@ namespace NppDarkMode
case MBI_PUSHED:
case MBI_DISABLEDPUSHED:
{
::FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::getSofterBackgroundBrush());
::FillRect(pUDMI->um.hdc, &pUDMI->dis.rcItem, NppDarkMode::getCtrlBackgroundBrush());
break;
}
@ -988,7 +988,7 @@ namespace NppDarkMode
HDC hdc = GetWindowDC(hWnd);
FillRect(hdc, &rcAnnoyingLine, NppDarkMode::getDarkerBackgroundBrush());
FillRect(hdc, &rcAnnoyingLine, NppDarkMode::getDlgBackgroundBrush());
ReleaseDC(hWnd, hdc);
}
@ -1673,7 +1673,7 @@ namespace NppDarkMode
PAINTSTRUCT ps{};
HDC hdc = ::BeginPaint(hWnd, &ps);
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDlgBackgroundBrush());
auto holdPen = static_cast<HPEN>(::SelectObject(hdc, NppDarkMode::getEdgePen()));
@ -1716,10 +1716,10 @@ namespace NppDarkMode
rcItem.right += 1;
// for consistency getBackgroundBrush()
// would be better, than getSofterBackgroundBrush(),
// would be better, than getCtrlBackgroundBrush(),
// however default getBackgroundBrush() has same color
// as getDarkerBackgroundBrush()
::FillRect(hdc, &rcItem, isSelectedTab ? NppDarkMode::getDarkerBackgroundBrush() : bHot ? NppDarkMode::getHotBackgroundBrush() : NppDarkMode::getSofterBackgroundBrush());
// as getDlgBackgroundBrush()
::FillRect(hdc, &rcItem, isSelectedTab ? NppDarkMode::getDlgBackgroundBrush() : bHot ? NppDarkMode::getHotBackgroundBrush() : NppDarkMode::getCtrlBackgroundBrush());
SetBkMode(hdc, TRANSPARENT);
@ -1871,7 +1871,7 @@ namespace NppDarkMode
rcClient.bottom += pBorderMetricsData->_yScroll;
}
HPEN hPen = ::CreatePen(PS_SOLID, 1, NppDarkMode::getBackgroundColor());
HPEN hPen = ::CreatePen(PS_SOLID, 1, (::IsWindowEnabled(hWnd) == TRUE) ? NppDarkMode::getBackgroundColor() : NppDarkMode::getDlgBackgroundColor());
RECT rcInner = rcClient;
::InflateRect(&rcInner, -1, -1);
NppDarkMode::paintRoundFrameRect(hdc, rcInner, hPen);
@ -2046,7 +2046,7 @@ namespace NppDarkMode
RECT rcArrow{ cbi.rcButton };
rcArrow.left -= 1;
HBRUSH hSelectedBrush = isDisabled ? NppDarkMode::getDarkerBackgroundBrush() : (isHot ? NppDarkMode::getHotBackgroundBrush() : NppDarkMode::getSofterBackgroundBrush());
HBRUSH hSelectedBrush = isDisabled ? NppDarkMode::getDlgBackgroundBrush() : (isHot ? NppDarkMode::getHotBackgroundBrush() : NppDarkMode::getCtrlBackgroundBrush());
// CBS_DROPDOWN text is handled by parent by WM_CTLCOLOREDIT
if (comboboxData._cbStyle == CBS_DROPDOWNLIST)
@ -2135,14 +2135,14 @@ namespace NppDarkMode
::ExcludeClipRect(hdc, cbi.rcItem.left, cbi.rcItem.top, cbi.rcItem.right, cbi.rcItem.bottom);
::ExcludeClipRect(hdc, rcArrow.left - 1, rcArrow.top, rcArrow.right, rcArrow.bottom);
HPEN hPen = ::CreatePen(PS_SOLID, 1, isDisabled ? NppDarkMode::getDarkerBackgroundColor() : NppDarkMode::getBackgroundColor());
HPEN hPen = ::CreatePen(PS_SOLID, 1, isDisabled ? NppDarkMode::getDlgBackgroundColor() : NppDarkMode::getBackgroundColor());
RECT rcInner{ rcClient };
::InflateRect(&rcInner, -1, -1);
rcInner.right = rcArrow.left - 1;
NppDarkMode::paintRoundFrameRect(hdc, rcInner, hPen);
::DeleteObject(hPen);
::InflateRect(&rcInner, -1, -1);
::FillRect(hdc, &rcInner, isDisabled ? NppDarkMode::getDarkerBackgroundBrush() : NppDarkMode::getSofterBackgroundBrush());
::FillRect(hdc, &rcInner, isDisabled ? NppDarkMode::getDlgBackgroundBrush() : NppDarkMode::getCtrlBackgroundBrush());
}
const int roundCornerValue = NppDarkMode::isWindows11() ? 4 : 0;
@ -2378,7 +2378,7 @@ namespace NppDarkMode
PAINTSTRUCT ps{};
auto hdc = ::BeginPaint(hWnd, &ps);
::FillRect(hdc, &rcClient, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(hdc, &rcClient, NppDarkMode::getDlgBackgroundBrush());
RECT rcArrowPrev{};
RECT rcArrowNext{};
@ -2478,7 +2478,7 @@ namespace NppDarkMode
{
RECT rcClient{};
::GetClientRect(hWnd, &rcClient);
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;
@ -2835,7 +2835,7 @@ namespace NppDarkMode
roundCornerValue = 5;
}
::FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(nmtbcd->nmcd.hdc, &nmtbcd->nmcd.rc, NppDarkMode::getDlgBackgroundBrush());
lr |= CDRF_NOTIFYITEMDRAW;
}
@ -2855,7 +2855,7 @@ namespace NppDarkMode
nmtbcd->clrText = NppDarkMode::getTextColor();
nmtbcd->clrTextHighlight = NppDarkMode::getTextColor();
nmtbcd->clrBtnFace = NppDarkMode::getBackgroundColor();
nmtbcd->clrBtnHighlight = NppDarkMode::getSofterBackgroundColor();
nmtbcd->clrBtnHighlight = NppDarkMode::getCtrlBackgroundColor();
nmtbcd->clrHighlightHotTrack = NppDarkMode::getHotBackgroundColor();
nmtbcd->nStringBkMode = TRANSPARENT;
nmtbcd->nHLStringBkMode = TRANSPARENT;
@ -2872,7 +2872,7 @@ namespace NppDarkMode
}
else if ((nmtbcd->nmcd.uItemState & CDIS_CHECKED) == CDIS_CHECKED)
{
auto holdBrush = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getSofterBackgroundBrush());
auto holdBrush = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getCtrlBackgroundBrush());
auto holdPen = ::SelectObject(nmtbcd->nmcd.hdc, NppDarkMode::getEdgePen());
::RoundRect(nmtbcd->nmcd.hdc, nmtbcd->nmcd.rc.left, nmtbcd->nmcd.rc.top, nmtbcd->nmcd.rc.right, nmtbcd->nmcd.rc.bottom, roundCornerValue, roundCornerValue);
::SelectObject(nmtbcd->nmcd.hdc, holdBrush);
@ -2927,9 +2927,9 @@ namespace NppDarkMode
if (isSelected)
{
lplvcd->clrText = NppDarkMode::getTextColor();
lplvcd->clrTextBk = NppDarkMode::getSofterBackgroundColor();
lplvcd->clrTextBk = NppDarkMode::getCtrlBackgroundColor();
::FillRect(lplvcd->nmcd.hdc, &lplvcd->nmcd.rc, NppDarkMode::getSofterBackgroundBrush());
::FillRect(lplvcd->nmcd.hdc, &lplvcd->nmcd.rc, NppDarkMode::getCtrlBackgroundBrush());
}
else if ((lplvcd->nmcd.uItemState & CDIS_HOT) == CDIS_HOT)
{
@ -2988,8 +2988,8 @@ namespace NppDarkMode
if ((lptvcd->nmcd.uItemState & CDIS_SELECTED) == CDIS_SELECTED)
{
lptvcd->clrText = NppDarkMode::getTextColor();
lptvcd->clrTextBk = NppDarkMode::getSofterBackgroundColor();
::FillRect(lptvcd->nmcd.hdc, &lptvcd->nmcd.rc, NppDarkMode::getSofterBackgroundBrush());
lptvcd->clrTextBk = NppDarkMode::getCtrlBackgroundColor();
::FillRect(lptvcd->nmcd.hdc, &lptvcd->nmcd.rc, NppDarkMode::getCtrlBackgroundBrush());
lr |= CDRF_NEWFONT | CDRF_NOTIFYPOSTPAINT;
}
@ -3083,7 +3083,7 @@ namespace NppDarkMode
}
else if ((lpnmcd->uItemState & CDIS_SELECTED) == CDIS_SELECTED)
{
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getSofterBackgroundBrush());
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getCtrlBackgroundBrush());
LRESULT lr = CDRF_SKIPDEFAULT;
if (isPlugin)
{
@ -3098,12 +3098,12 @@ namespace NppDarkMode
{
if (::IsWindowEnabled(lpnmcd->hdr.hwndFrom) == FALSE)
{
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getDlgBackgroundBrush());
NppDarkMode::paintRoundFrameRect(lpnmcd->hdc, lpnmcd->rc, NppDarkMode::getDisabledEdgePen(), 0, 0);
}
else
{
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getSofterBackgroundBrush());
::FillRect(lpnmcd->hdc, &lpnmcd->rc, NppDarkMode::getCtrlBackgroundBrush());
}
LRESULT lr = CDRF_SKIPDEFAULT;
@ -3147,7 +3147,7 @@ namespace NppDarkMode
{
RECT rect{};
GetClientRect(hWnd, &rect);
::FillRect(reinterpret_cast<HDC>(wParam), &rect, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rect, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;
@ -3169,7 +3169,7 @@ namespace NppDarkMode
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
break;
}
@ -3188,7 +3188,7 @@ namespace NppDarkMode
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
break;
}
@ -3205,7 +3205,7 @@ namespace NppDarkMode
{
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
}
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
break;
}
@ -3488,8 +3488,8 @@ namespace NppDarkMode
if (NppDarkMode::isEnabled())
{
scheme.clrBtnHighlight = NppDarkMode::getDarkerBackgroundColor();
scheme.clrBtnShadow = NppDarkMode::getDarkerBackgroundColor();
scheme.clrBtnHighlight = NppDarkMode::getDlgBackgroundColor();
scheme.clrBtnShadow = NppDarkMode::getDlgBackgroundColor();
}
else
{
@ -3686,7 +3686,7 @@ namespace NppDarkMode
return reinterpret_cast<LRESULT>(NppDarkMode::getBackgroundBrush());
}
LRESULT onCtlColorSofter(HDC hdc)
LRESULT onCtlColorCtrl(HDC hdc)
{
if (!NppDarkMode::isEnabled())
{
@ -3694,11 +3694,11 @@ namespace NppDarkMode
}
::SetTextColor(hdc, NppDarkMode::getTextColor());
::SetBkColor(hdc, NppDarkMode::getSofterBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getSofterBackgroundBrush());
::SetBkColor(hdc, NppDarkMode::getCtrlBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getCtrlBackgroundBrush());
}
LRESULT onCtlColorDarker(HDC hdc)
LRESULT onCtlColorDlg(HDC hdc)
{
if (!NppDarkMode::isEnabled())
{
@ -3706,8 +3706,8 @@ namespace NppDarkMode
}
::SetTextColor(hdc, NppDarkMode::getTextColor());
::SetBkColor(hdc, NppDarkMode::getDarkerBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getDarkerBackgroundBrush());
::SetBkColor(hdc, NppDarkMode::getDlgBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getDlgBackgroundBrush());
}
LRESULT onCtlColorError(HDC hdc)
@ -3722,7 +3722,7 @@ namespace NppDarkMode
return reinterpret_cast<LRESULT>(NppDarkMode::getErrorBackgroundBrush());
}
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled)
LRESULT onCtlColorDlgStaticText(HDC hdc, bool isTextEnabled)
{
if (!NppDarkMode::isEnabled())
{
@ -3731,22 +3731,24 @@ namespace NppDarkMode
}
::SetTextColor(hdc, isTextEnabled ? NppDarkMode::getTextColor() : NppDarkMode::getDisabledTextColor());
::SetBkColor(hdc, NppDarkMode::getDarkerBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getDarkerBackgroundBrush());
::SetBkColor(hdc, NppDarkMode::getDlgBackgroundColor());
return reinterpret_cast<LRESULT>(NppDarkMode::getDlgBackgroundBrush());
}
INT_PTR onCtlColorListbox(WPARAM wParam, LPARAM lParam)
LRESULT onCtlColorListbox(WPARAM wParam, LPARAM lParam)
{
auto hdc = reinterpret_cast<HDC>(wParam);
auto hwnd = reinterpret_cast<HWND>(lParam);
auto style = ::GetWindowLongPtr(hwnd, GWL_STYLE);
bool isComboBox = (style & LBS_COMBOBOX) == LBS_COMBOBOX;
if (!isComboBox && ::IsWindowEnabled(hwnd))
if ((!isComboBox || !NppDarkMode::isExperimentalActive()))
{
return static_cast<INT_PTR>(NppDarkMode::onCtlColorSofter(hdc));
if (::IsWindowEnabled(hwnd))
return NppDarkMode::onCtlColorCtrl(hdc);
return NppDarkMode::onCtlColorDlg(hdc);
}
return static_cast<INT_PTR>(NppDarkMode::onCtlColor(hdc));
return NppDarkMode::onCtlColor(hdc);
}
}

View File

@ -129,9 +129,9 @@ namespace NppDarkMode
void setDarkTone(ColorTone colorToneChoice);
COLORREF getBackgroundColor();
COLORREF getSofterBackgroundColor();
COLORREF getCtrlBackgroundColor();
COLORREF getHotBackgroundColor();
COLORREF getDarkerBackgroundColor();
COLORREF getDlgBackgroundColor();
COLORREF getErrorBackgroundColor();
COLORREF getTextColor();
@ -144,8 +144,8 @@ namespace NppDarkMode
COLORREF getDisabledEdgeColor();
HBRUSH getBackgroundBrush();
HBRUSH getDarkerBackgroundBrush();
HBRUSH getSofterBackgroundBrush();
HBRUSH getDlgBackgroundBrush();
HBRUSH getCtrlBackgroundBrush();
HBRUSH getHotBackgroundBrush();
HBRUSH getErrorBackgroundBrush();
@ -159,9 +159,9 @@ namespace NppDarkMode
HPEN getDisabledEdgePen();
void setBackgroundColor(COLORREF c);
void setSofterBackgroundColor(COLORREF c);
void setCtrlBackgroundColor(COLORREF c);
void setHotBackgroundColor(COLORREF c);
void setDarkerBackgroundColor(COLORREF c);
void setDlgBackgroundColor(COLORREF c);
void setErrorBackgroundColor(COLORREF c);
void setTextColor(COLORREF c);
void setDarkerTextColor(COLORREF c);
@ -235,9 +235,9 @@ namespace NppDarkMode
void setDarkAutoCompletion();
LRESULT onCtlColor(HDC hdc);
LRESULT onCtlColorSofter(HDC hdc);
LRESULT onCtlColorDarker(HDC hdc);
LRESULT onCtlColorCtrl(HDC hdc);
LRESULT onCtlColorDlg(HDC hdc);
LRESULT onCtlColorError(HDC hdc);
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled);
INT_PTR onCtlColorListbox(WPARAM wParam, LPARAM lParam);
LRESULT onCtlColorDlgStaticText(HDC hdc, bool isTextEnabled);
LRESULT onCtlColorListbox(WPARAM wParam, LPARAM lParam);
}

View File

@ -1094,7 +1094,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -1105,7 +1105,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1123,7 +1123,7 @@ intptr_t CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;
@ -1467,7 +1467,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -1478,7 +1478,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1496,7 +1496,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;
@ -5920,7 +5920,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
{
if (FSNotFound != getFindStatus())
{
return NppDarkMode::onCtlColorSofter(hdc);
return NppDarkMode::onCtlColorCtrl(hdc);
}
else // text not found
{
@ -5943,7 +5943,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -6070,7 +6070,7 @@ intptr_t CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
{
RECT rcClient{};
GetClientRect(_hSelf, &rcClient);
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rcClient, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
else
@ -6410,7 +6410,7 @@ int Progress::createProgressWindow()
// Set border so user can distinguish easier progress bar,
// especially, when getBackgroundColor is very similar or same
// as getDarkerBackgroundColor
// as getDlgBackgroundColor
NppDarkMode::setBorder(_hPBar, NppDarkMode::isEnabled());
NppDarkMode::disableVisualStyle(_hPBar, NppDarkMode::isEnabled());
if (NppDarkMode::isEnabled())
@ -6558,7 +6558,7 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wparam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wparam));
}
break;
}
@ -6567,7 +6567,7 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wparam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wparam));
}
// transparent background for text, same as main window background
return reinterpret_cast<LRESULT>(::GetSysColorBrush(NULL_BRUSH));
@ -6587,11 +6587,12 @@ LRESULT APIENTRY Progress::wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM l
if (NppDarkMode::isEnabled())
{
RECT rc{};
GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wparam), &rc, NppDarkMode::getDarkerBackgroundBrush());
}
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wparam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;
}
case WM_SETFOCUS:
{

View File

@ -22,7 +22,7 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
{
switch (message)
{
case WM_INITDIALOG :
case WM_INITDIALOG:
{
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
@ -33,13 +33,23 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
const auto hdcStatic = reinterpret_cast<HDC>(wParam);
const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
if (dlgCtrlID == ID_CURRLINE_EDIT)
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -51,18 +61,6 @@ intptr_t CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);

View File

@ -112,13 +112,13 @@ intptr_t CALLBACK SharedParametersDialog::run_dlgProc(UINT Message, WPARAM wPara
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1101,7 +1101,7 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -1112,7 +1112,7 @@ intptr_t CALLBACK UserDefineDialog::run_dlgProc(UINT message, WPARAM wParam, LPA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1636,13 +1636,13 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1654,18 +1654,6 @@ intptr_t CALLBACK StringDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);
@ -1894,7 +1882,7 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -1905,7 +1893,7 @@ intptr_t CALLBACK StylerDlg::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -89,7 +89,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -99,7 +99,7 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -115,9 +115,9 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
if (isStaticText)
{
bool isTextEnabled = isCheckedOrNot(IDC_COL_NUM_RADIO);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -129,18 +129,6 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
if (NppDarkMode::isEnabled())

View File

@ -76,7 +76,7 @@ intptr_t CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPar
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -459,7 +459,7 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -606,7 +606,7 @@ intptr_t CALLBACK DoSaveOrNotBox::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -724,7 +724,7 @@ intptr_t CALLBACK DoSaveAllBox::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -178,7 +178,7 @@ LRESULT ColourPicker::runProc(UINT Message, WPARAM wParam, LPARAM lParam)
{
if ((BOOL)wParam == FALSE)
{
_currentColour = NppDarkMode::isEnabled() ? NppDarkMode::getDarkerBackgroundColor() : ::GetSysColor(COLOR_3DFACE);
_currentColour = NppDarkMode::isEnabled() ? NppDarkMode::getDlgBackgroundColor() : ::GetSysColor(COLOR_3DFACE);
redraw();
}
return TRUE;

View File

@ -116,7 +116,7 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
return reinterpret_cast<LRESULT>(::GetStockObject(NULL_BRUSH));
}
@ -124,11 +124,7 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
break;
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -205,7 +201,7 @@ intptr_t CALLBACK ColourPopup::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
}
else
{
hbrush = CreateSolidBrush(NppDarkMode::isEnabled() ? NppDarkMode::getDarkerBackgroundColor() : GetSysColor(COLOR_3DFACE));
hbrush = CreateSolidBrush(NppDarkMode::isEnabled() ? NppDarkMode::getDlgBackgroundColor() : GetSysColor(COLOR_3DFACE));
FrameRect(hdc, &rc, hbrush);
DeleteObject(hbrush);
}
@ -310,22 +306,17 @@ uintptr_t CALLBACK ColourPopup::chooseColorDlgProc(HWND hwnd, UINT message, WPAR
case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
}
break;
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
{
[[fallthrough]];
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
break;
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -343,7 +334,7 @@ uintptr_t CALLBACK ColourPopup::chooseColorDlgProc(HWND hwnd, UINT message, WPAR
{
RECT rc = {};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
break;

View File

@ -41,7 +41,7 @@ LRESULT CALLBACK ColourStaticTextHooker::colourStaticProc(HWND hwnd, UINT Messag
if (NppDarkMode::isEnabled())
{
::SetBkColor(hdc, NppDarkMode::getDarkerBackgroundColor());
::SetBkColor(hdc, NppDarkMode::getDlgBackgroundColor());
}
// Get the default GUI font
@ -179,7 +179,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -189,7 +189,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -230,14 +230,14 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM
isTextEnabled = style._fontSize != STYLE_NOT_USED && style._fontSize < 100; // style._fontSize has only 2 digits
}
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
if (dlgCtrlID == IDC_DEF_EXT_EDIT || dlgCtrlID == IDC_DEF_KEYWORDS_EDIT)
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:

View File

@ -291,8 +291,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR
RECT rc{};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
@ -492,7 +491,7 @@ void DockingCont::drawCaptionItem(DRAWITEMSTRUCT *pDrawItemStruct)
if (NppDarkMode::isEnabled())
{
bgbrush = ::CreateSolidBrush(_isActive ? NppDarkMode::getSofterBackgroundColor() : NppDarkMode::getBackgroundColor());
bgbrush = ::CreateSolidBrush(_isActive ? NppDarkMode::getCtrlBackgroundColor() : NppDarkMode::getBackgroundColor());
SetTextColor(hDc, NppDarkMode::getTextColor());
}
else
@ -727,8 +726,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
RECT rc {};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
@ -747,7 +745,7 @@ LRESULT DockingCont::runProcTab(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
PAINTSTRUCT ps{};
HDC hdc = ::BeginPaint(hwnd, &ps);
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(hdc, &ps.rcPaint, NppDarkMode::getDlgBackgroundBrush());
UINT id = ::GetDlgCtrlID(hwnd);
@ -1080,7 +1078,7 @@ void DockingCont::drawTabItem(DRAWITEMSTRUCT* pDrawItemStruct)
if (NppDarkMode::isEnabled())
{
::FillRect(hDc, &rc, isSelected ? NppDarkMode::getSofterBackgroundBrush() : NppDarkMode::getBackgroundBrush());
::FillRect(hDc, &rc, isSelected ? NppDarkMode::getCtrlBackgroundBrush() : NppDarkMode::getBackgroundBrush());
::OffsetRect(&rc, 0, -onePadding);
}
else if (isSelected) // draw orange bar
@ -1206,14 +1204,14 @@ intptr_t CALLBACK DockingCont::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
::ExcludeClipRect(hDC, rcClientTab.left, rcClientTab.top, rcClientTab.right, rcClientTab.bottom);
::ExcludeClipRect(hDC, rcCap.left, rcCap.top, rcCap.right, rcCap.bottom);
::FillRect(hDC, &rc, NppDarkMode::isEnabled() ? NppDarkMode::getDarkerBackgroundBrush() : ::GetSysColorBrush(COLOR_3DFACE));
::FillRect(hDC, &rc, NppDarkMode::isEnabled() ? NppDarkMode::getDlgBackgroundBrush() : ::GetSysColorBrush(COLOR_3DFACE));
return TRUE;
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_DRAWITEM :

View File

@ -102,7 +102,7 @@ protected :
RECT rc = {};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
case WM_NOTIFY:

View File

@ -225,8 +225,7 @@ LRESULT DockingManager::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
RECT rc{};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}

View File

@ -153,8 +153,7 @@ LRESULT DockingSplitter::runProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
RECT rc{};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
default :

View File

@ -46,12 +46,12 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -63,9 +63,9 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
if (dlgCtrlID == IDC_STATIC)
{
const bool isTextEnabled = isCheckedOrNot(IDC_MYRANGE_RADIO);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -77,18 +77,6 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam,
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);

View File

@ -813,7 +813,7 @@ intptr_t CALLBACK FunctionListPanel::run_dlgProc(UINT message, WPARAM wParam, LP
{
if (textFound)
{
return NppDarkMode::onCtlColorSofter(hdc);
return NppDarkMode::onCtlColorCtrl(hdc);
}
else // text not found
{

View File

@ -132,10 +132,10 @@ void ShortcutMapper::initBabyGrid()
_babygrid.setUnprotectColor(NppDarkMode::getBackgroundColor());
_babygrid.setTitleColor(NppDarkMode::getBackgroundColor());
_babygrid.setBackgroundColor(NppDarkMode::getDarkerBackgroundColor());
_babygrid.setBackgroundColor(NppDarkMode::getDlgBackgroundColor());
_babygrid.setHighlightColor(NppDarkMode::getHotBackgroundColor());
_babygrid.setHighlightColorNoFocus(NppDarkMode::getSofterBackgroundColor());
_babygrid.setHighlightColorNoFocus(NppDarkMode::getCtrlBackgroundColor());
_babygrid.setProtectColor(NppDarkMode::getErrorBackgroundColor());
_babygrid.setHighlightColorProtect(RGB(244, 10, 20));
_babygrid.setHighlightColorProtectNoFocus(RGB(230, 100, 110));
@ -616,13 +616,13 @@ intptr_t CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -1138,12 +1138,12 @@ intptr_t CALLBACK PluginsAdminDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
{
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -1155,7 +1155,7 @@ intptr_t CALLBACK PluginsAdminDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
{
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
}
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
break;
}

View File

@ -226,7 +226,7 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -665,7 +665,7 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1193,7 +1193,7 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -1203,7 +1203,7 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -1213,9 +1213,9 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
// handle blurry text with disabled states for the affected static controls
if (dlgCtrlID == IDC_CARETLINEFRAME_WIDTH_STATIC || dlgCtrlID == IDC_CARETLINEFRAME_WIDTH_DISPLAY)
{
return NppDarkMode::onCtlColorDarkerBGStaticText(reinterpret_cast<HDC>(wParam), (svp._currentLineHiliteMode == LINEHILITE_FRAME));
return NppDarkMode::onCtlColorDlgStaticText(reinterpret_cast<HDC>(wParam), (svp._currentLineHiliteMode == LINEHILITE_FRAME));
}
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1458,13 +1458,13 @@ intptr_t CALLBACK Editing2SubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1603,9 +1603,9 @@ intptr_t CALLBACK Editing2SubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
void DarkModeSubDlg::enableCustomizedColorCtrls(bool doEnable)
{
::EnableWindow(_pBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pSofterBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pCtrlBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pHotBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pPureBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pDlgBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pErrorBackgroundColorPicker->getHSelf(), doEnable);
::EnableWindow(_pTextColorPicker->getHSelf(), doEnable);
::EnableWindow(_pDarkerTextColorPicker->getHSelf(), doEnable);
@ -1620,9 +1620,9 @@ void DarkModeSubDlg::enableCustomizedColorCtrls(bool doEnable)
if (doEnable)
{
_pBackgroundColorPicker->setColour(NppDarkMode::getBackgroundColor());
_pSofterBackgroundColorPicker->setColour(NppDarkMode::getSofterBackgroundColor());
_pCtrlBackgroundColorPicker->setColour(NppDarkMode::getCtrlBackgroundColor());
_pHotBackgroundColorPicker->setColour(NppDarkMode::getHotBackgroundColor());
_pPureBackgroundColorPicker->setColour(NppDarkMode::getDarkerBackgroundColor());
_pDlgBackgroundColorPicker->setColour(NppDarkMode::getDlgBackgroundColor());
_pErrorBackgroundColorPicker->setColour(NppDarkMode::getErrorBackgroundColor());
_pTextColorPicker->setColour(NppDarkMode::getTextColor());
_pDarkerTextColorPicker->setColour(NppDarkMode::getDarkerTextColor());
@ -1699,9 +1699,9 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, TRUE, 0);
_pBackgroundColorPicker = new ColourPicker;
_pSofterBackgroundColorPicker = new ColourPicker;
_pCtrlBackgroundColorPicker = new ColourPicker;
_pHotBackgroundColorPicker = new ColourPicker;
_pPureBackgroundColorPicker = new ColourPicker;
_pDlgBackgroundColorPicker = new ColourPicker;
_pErrorBackgroundColorPicker = new ColourPicker;
_pTextColorPicker = new ColourPicker;
_pDarkerTextColorPicker = new ColourPicker;
@ -1712,9 +1712,9 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
_pDisabledEdgeColorPicker = new ColourPicker;
_pBackgroundColorPicker->init(_hInst, _hSelf);
_pSofterBackgroundColorPicker->init(_hInst, _hSelf);
_pCtrlBackgroundColorPicker->init(_hInst, _hSelf);
_pHotBackgroundColorPicker->init(_hInst, _hSelf);
_pPureBackgroundColorPicker->init(_hInst, _hSelf);
_pDlgBackgroundColorPicker->init(_hInst, _hSelf);
_pErrorBackgroundColorPicker->init(_hInst, _hSelf);
_pTextColorPicker->init(_hInst, _hSelf);
@ -1728,10 +1728,10 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
_dpiManager.setDpi(_hSelf);
const int cpDynamicalSize = _dpiManager.scale(25);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR1_STATIC, _pPureBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR1_STATIC, _pBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR2_STATIC, _pHotBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR3_STATIC, _pSofterBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR4_STATIC, _pBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR3_STATIC, _pCtrlBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR4_STATIC, _pDlgBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR5_STATIC, _pErrorBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR6_STATIC, _pTextColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR7_STATIC, _pDarkerTextColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
@ -1742,9 +1742,9 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
move2CtrlLeft(IDD_CUSTOMIZED_COLOR12_STATIC, _pDisabledEdgeColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
_pBackgroundColorPicker->display();
_pSofterBackgroundColorPicker->display();
_pCtrlBackgroundColorPicker->display();
_pHotBackgroundColorPicker->display();
_pPureBackgroundColorPicker->display();
_pDlgBackgroundColorPicker->display();
_pErrorBackgroundColorPicker->display();
_pTextColorPicker->display();
_pDarkerTextColorPicker->display();
@ -1770,7 +1770,7 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -1794,10 +1794,10 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
if (isStaticText)
{
bool isTextEnabled = nppGUI._darkmode._isEnabled && nppGUI._darkmode._colorTone == NppDarkMode::customizedTone;
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -1812,9 +1812,9 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_DESTROY:
{
_pBackgroundColorPicker->destroy();
_pSofterBackgroundColorPicker->destroy();
_pCtrlBackgroundColorPicker->destroy();
_pHotBackgroundColorPicker->destroy();
_pPureBackgroundColorPicker->destroy();
_pDlgBackgroundColorPicker->destroy();
_pErrorBackgroundColorPicker->destroy();
_pTextColorPicker->destroy();
_pDarkerTextColorPicker->destroy();
@ -1825,9 +1825,9 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
_pDisabledEdgeColorPicker->destroy();
delete _pBackgroundColorPicker;
delete _pSofterBackgroundColorPicker;
delete _pCtrlBackgroundColorPicker;
delete _pHotBackgroundColorPicker;
delete _pPureBackgroundColorPicker;
delete _pDlgBackgroundColorPicker;
delete _pErrorBackgroundColorPicker;
delete _pTextColorPicker;
delete _pDarkerTextColorPicker;
@ -1846,10 +1846,10 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{
const int cpDynamicalSize = _dpiManager.scale(25);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR1_STATIC, _pPureBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR1_STATIC, _pBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR2_STATIC, _pHotBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR3_STATIC, _pSofterBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR4_STATIC, _pBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR3_STATIC, _pCtrlBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR4_STATIC, _pDlgBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR5_STATIC, _pErrorBackgroundColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR6_STATIC, _pTextColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
move2CtrlLeft(IDD_CUSTOMIZED_COLOR7_STATIC, _pDarkerTextColorPicker->getHSelf(), cpDynamicalSize, cpDynamicalSize);
@ -2096,10 +2096,10 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
NppDarkMode::setBackgroundColor(c);
nppGUI._darkmode._customColors.background = c;
}
else if (reinterpret_cast<HWND>(lParam) == _pSofterBackgroundColorPicker->getHSelf())
else if (reinterpret_cast<HWND>(lParam) == _pCtrlBackgroundColorPicker->getHSelf())
{
c = _pSofterBackgroundColorPicker->getColour();
NppDarkMode::setSofterBackgroundColor(c);
c = _pCtrlBackgroundColorPicker->getColour();
NppDarkMode::setCtrlBackgroundColor(c);
nppGUI._darkmode._customColors.softerBackground = c;
}
else if (reinterpret_cast<HWND>(lParam) == _pHotBackgroundColorPicker->getHSelf())
@ -2108,10 +2108,10 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
NppDarkMode::setHotBackgroundColor(c);
nppGUI._darkmode._customColors.hotBackground = c;
}
else if (reinterpret_cast<HWND>(lParam) == _pPureBackgroundColorPicker->getHSelf())
else if (reinterpret_cast<HWND>(lParam) == _pDlgBackgroundColorPicker->getHSelf())
{
c = _pPureBackgroundColorPicker->getColour();
NppDarkMode::setDarkerBackgroundColor(c);
c = _pDlgBackgroundColorPicker->getColour();
NppDarkMode::setDlgBackgroundColor(c);
nppGUI._darkmode._customColors.pureBackground = c;
}
else if (reinterpret_cast<HWND>(lParam) == _pErrorBackgroundColorPicker->getHSelf())
@ -2186,12 +2186,12 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{
if (!doEnableCustomizedColorCtrls)
{
COLORREF disabledColor = nppGUI._darkmode._isEnabled ? NppDarkMode::getDarkerBackgroundColor() : ::GetSysColor(COLOR_3DFACE);
COLORREF disabledColor = nppGUI._darkmode._isEnabled ? NppDarkMode::getDlgBackgroundColor() : ::GetSysColor(COLOR_3DFACE);
_pBackgroundColorPicker->setColour(disabledColor);
_pSofterBackgroundColorPicker->setColour(disabledColor);
_pCtrlBackgroundColorPicker->setColour(disabledColor);
_pHotBackgroundColorPicker->setColour(disabledColor);
_pPureBackgroundColorPicker->setColour(disabledColor);
_pDlgBackgroundColorPicker->setColour(disabledColor);
_pErrorBackgroundColorPicker->setColour(disabledColor);
_pTextColorPicker->setColour(disabledColor);
_pDarkerTextColorPicker->setColour(disabledColor);
@ -2331,13 +2331,13 @@ intptr_t CALLBACK MarginsBorderEdgeSubDlg::run_dlgProc(UINT message, WPARAM wPar
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -2638,7 +2638,7 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -2649,7 +2649,7 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -2961,7 +2961,7 @@ intptr_t CALLBACK NewDocumentSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -3109,13 +3109,13 @@ intptr_t CALLBACK DefaultDirectorySubDlg::run_dlgProc(UINT message, WPARAM wPara
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -3233,12 +3233,12 @@ intptr_t CALLBACK RecentFilesHistorySubDlg::run_dlgProc(UINT message, WPARAM wPa
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -3250,9 +3250,9 @@ intptr_t CALLBACK RecentFilesHistorySubDlg::run_dlgProc(UINT message, WPARAM wPa
if (dlgCtrlID == IDC_CUSTOMIZELENGTH_RANGE_STATIC)
{
const bool isTextEnabled = isCheckedOrNot(IDC_RADIO_CUSTOMIZELENTH);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -3494,7 +3494,7 @@ intptr_t CALLBACK IndentationSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -3504,7 +3504,7 @@ intptr_t CALLBACK IndentationSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -3518,12 +3518,12 @@ intptr_t CALLBACK IndentationSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP
const Lang* lang = nppParam.getLangFromIndex(index - 1);
if (lang == nullptr)
{
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
const bool useDefaultTab = isCheckedOrNot(IDC_CHECK_DEFAULTTABVALUE);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, !useDefaultTab);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, !useDefaultTab);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -3898,7 +3898,7 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -3909,7 +3909,7 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -4192,7 +4192,7 @@ intptr_t CALLBACK HighlightingSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -4433,7 +4433,7 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -4443,7 +4443,7 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -4454,7 +4454,7 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -4742,12 +4742,12 @@ intptr_t CALLBACK BackupSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -4762,20 +4762,20 @@ intptr_t CALLBACK BackupSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
if (isStaticText)
{
bool isTextEnabled = isCheckedOrNot(IDC_BACKUPDIR_RESTORESESSION_CHECK);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
if (dlgCtrlID == IDD_BACKUPDIR_STATIC)
{
bool isTextEnabled = !isCheckedOrNot(IDC_RADIO_BKNONE) && isCheckedOrNot(IDC_BACKUPDIR_CHECK);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
if (dlgCtrlID == IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT)
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -5081,12 +5081,12 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -5103,10 +5103,10 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
if (isStaticText)
{
const bool isTextEnabled = isCheckedOrNot(IDD_AUTOC_ENABLECHECK);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -5365,13 +5365,13 @@ intptr_t CALLBACK MultiInstanceSubDlg::run_dlgProc(UINT message, WPARAM wParam,
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -5676,12 +5676,12 @@ intptr_t CALLBACK DelimiterSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -5695,7 +5695,7 @@ intptr_t CALLBACK DelimiterSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
{
return NppDarkMode::onCtlColor(hdcStatic);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
else if (isBlabla)
{
@ -5850,12 +5850,12 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -5868,10 +5868,9 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
if (isStaticText)
{
bool isTextEnabled = isCheckedOrNot(IDC_CHECK_CLICKABLELINK_ENABLE);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -6054,12 +6053,12 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -6072,9 +6071,9 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L
if (isStaticText)
{
bool isTextEnabled = isCheckedOrNot(IDC_CHECK_PERFORMANCE_ENABLE);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:
@ -6253,13 +6252,13 @@ intptr_t CALLBACK SearchEngineSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -6365,13 +6364,13 @@ intptr_t CALLBACK SearchingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -109,9 +109,9 @@ public:
private:
ColourPicker* _pBackgroundColorPicker = nullptr;
ColourPicker* _pSofterBackgroundColorPicker = nullptr;
ColourPicker* _pCtrlBackgroundColorPicker = nullptr;
ColourPicker* _pHotBackgroundColorPicker = nullptr;
ColourPicker* _pPureBackgroundColorPicker = nullptr;
ColourPicker* _pDlgBackgroundColorPicker = nullptr;
ColourPicker* _pErrorBackgroundColorPicker = nullptr;
ColourPicker* _pTextColorPicker = nullptr;
ColourPicker* _pDarkerTextColorPicker = nullptr;

View File

@ -1362,21 +1362,15 @@ intptr_t CALLBACK FileRelocalizerDlg::run_dlgProc(UINT Message, WPARAM wParam, L
return TRUE;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rect{};
GetClientRect(_hSelf, &rect);
::FillRect(reinterpret_cast<HDC>(wParam), &rect, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -397,11 +397,9 @@ LRESULT CALLBACK Splitter::spliterWndProc(UINT uMsg, WPARAM wParam, LPARAM lPara
break;
}
RECT rc = {};
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return 1;
}
@ -531,10 +529,10 @@ void Splitter::drawSplitter()
if (isDarkMode)
{
hBrush = NppDarkMode::getBackgroundBrush();
hBrushTop = NppDarkMode::getSofterBackgroundBrush();
hBrushTop = NppDarkMode::getCtrlBackgroundBrush();
holdPen = static_cast<HPEN>(::SelectObject(hdc, NppDarkMode::getDarkerTextPen()));
::FillRect(hdc, &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(hdc, &rc, NppDarkMode::getDlgBackgroundBrush());
}
else
{

View File

@ -262,7 +262,7 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -273,7 +273,7 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -285,18 +285,6 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);

View File

@ -208,7 +208,7 @@ static LRESULT CALLBACK StatusBarSubclass(HWND hWnd, UINT uMsg, WPARAM wParam, L
if (!isSizeGrip && i < (nParts - 1))
{
FillRect(hdc, &rcDivider, NppDarkMode::getSofterBackgroundBrush());
FillRect(hdc, &rcDivider, NppDarkMode::getCtrlBackgroundBrush());
}
}

View File

@ -1194,7 +1194,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
RECT rc{};
::GetClientRect(hwnd, &rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
@ -1388,7 +1388,7 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT* pDrawItemStruct, bool isDarkMode)
::SendMessage(_hSelf, TCM_GETITEM, nTab, reinterpret_cast<LPARAM>(&tci));
const COLORREF colorActiveBg = isDarkMode ? NppDarkMode::getSofterBackgroundColor() : ::GetSysColor(COLOR_BTNFACE);
const COLORREF colorActiveBg = isDarkMode ? NppDarkMode::getCtrlBackgroundColor() : ::GetSysColor(COLOR_BTNFACE);
const COLORREF colorInactiveBgBase = isDarkMode ? NppDarkMode::getBackgroundColor() : ::GetSysColor(COLOR_BTNFACE);
COLORREF colorInactiveBg = liteGrey;

View File

@ -101,7 +101,7 @@ intptr_t CALLBACK TaskListDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM l
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -657,7 +657,7 @@ LRESULT CALLBACK RebarSubclass(
{
RECT rc{};
GetClientRect(hWnd, &rc);
FillRect((HDC)wParam, &rc, NppDarkMode::getDarkerBackgroundBrush());
::FillRect((HDC)wParam, &rc, NppDarkMode::getDlgBackgroundBrush());
return TRUE;
}
else

View File

@ -164,7 +164,7 @@ LRESULT VerticalFileSwitcher::listViewNotifyCustomDraw(HWND hWnd, UINT uMsg, WPA
{
if (isSelected)
{
bgColor = NppDarkMode::getSofterBackgroundColor();
bgColor = NppDarkMode::getCtrlBackgroundColor();
applyColor = true;
}
else if (isHot)

View File

@ -276,7 +276,7 @@ intptr_t CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -60,7 +60,7 @@ intptr_t CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -70,7 +70,7 @@ intptr_t CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORSTATIC:
@ -83,9 +83,9 @@ intptr_t CALLBACK RunMacroDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l
if (isStaticText)
{
const bool isTextEnabled = isCheckedOrNot(IDC_M_RUN_MULTI);
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
return NppDarkMode::onCtlColorDlgStaticText(hdcStatic, isTextEnabled);
}
return NppDarkMode::onCtlColorDarker(hdcStatic);
return NppDarkMode::onCtlColorDlg(hdcStatic);
}
case WM_PRINTCLIENT:

View File

@ -589,7 +589,7 @@ intptr_t CALLBACK Shortcut::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorCtrl(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORLISTBOX:
@ -599,17 +599,13 @@ intptr_t CALLBACK Shortcut::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
if (dlgCtrlID == IDC_NAME_EDIT)
{
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
}
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
break;
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -1295,17 +1291,13 @@ intptr_t CALLBACK ScintillaKeyMap::run_dlgProc(UINT Message, WPARAM wParam, LPAR
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
if (dlgCtrlID == IDC_NAME_EDIT)
{
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
}
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
break;
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:

View File

@ -33,7 +33,7 @@ intptr_t CALLBACK ButtonDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM /*l
case WM_CTLCOLORDLG:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
return NppDarkMode::onCtlColorDlg(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
@ -45,18 +45,6 @@ intptr_t CALLBACK ButtonDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM /*l
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc{};
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);