Apply dark mode on go to line dialog

Fix #10245, close #10246
pull/10256/head
ozone10 2021-07-25 16:59:47 +02:00 committed by Don Ho
parent a0c15274f5
commit f412a2d6f7
1 changed files with 50 additions and 1 deletions

View File

@ -24,10 +24,59 @@ INT_PTR CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
{
case WM_INITDIALOG :
{
NppDarkMode::autoSubclassAndThemeChildControls(_hSelf);
::SendDlgItemMessage(_hSelf, IDC_RADIO_GOTOLINE, BM_SETCHECK, TRUE, 0);
goToCenter();
return TRUE;
}
case WM_CTLCOLOREDIT:
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
}
break;
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
if (NppDarkMode::isEnabled())
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
break;
}
case WM_PRINTCLIENT:
{
if (NppDarkMode::isEnabled())
{
return TRUE;
}
break;
}
case WM_ERASEBKGND:
{
if (NppDarkMode::isEnabled())
{
RECT rc = { 0 };
getClientRect(rc);
::FillRect(reinterpret_cast<HDC>(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush());
return TRUE;
}
break;
}
case NPPM_INTERNAL_REFRESHDARKMODE:
{
NppDarkMode::autoThemeChildControls(_hSelf);
return TRUE;
}
case WM_COMMAND :
{
switch (wParam)
@ -117,6 +166,7 @@ INT_PTR CALLBACK GoToLineDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
default :
return FALSE;
}
return FALSE;
}
void GoToLineDlg::updateLinesNumbers() const
@ -138,4 +188,3 @@ void GoToLineDlg::updateLinesNumbers() const
::SetDlgItemInt(_hSelf, ID_CURRLINE, current, FALSE);
::SetDlgItemInt(_hSelf, ID_LASTLINE, limit, FALSE);
}