mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 22:04:55 +02:00
Apply darkmode on missing preference dialog items
- Edit control in Date Time for Custom format - Tooltip in Delimiter for Word character list - Fix blurry text in Link for Clickable Link Settings Fix #11497, close #11498
This commit is contained in:
parent
46ce9c31df
commit
b88e2fe57f
@ -1725,4 +1725,22 @@ namespace NppDarkMode
|
|||||||
::SetBkColor(hdc, NppDarkMode::getErrorBackgroundColor());
|
::SetBkColor(hdc, NppDarkMode::getErrorBackgroundColor());
|
||||||
return reinterpret_cast<LRESULT>(NppDarkMode::getErrorBackgroundBrush());
|
return reinterpret_cast<LRESULT>(NppDarkMode::getErrorBackgroundBrush());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled)
|
||||||
|
{
|
||||||
|
LRESULT result = FALSE;
|
||||||
|
|
||||||
|
if (NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
::SetTextColor(hdc, isTextEnabled ? NppDarkMode::getTextColor() : NppDarkMode::getDisabledTextColor());
|
||||||
|
::SetBkColor(hdc, NppDarkMode::getDarkerBackgroundColor());
|
||||||
|
result = reinterpret_cast<LRESULT>(NppDarkMode::getDarkerBackgroundBrush());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
::SetTextColor(hdc, ::GetSysColor(isTextEnabled ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,4 +169,5 @@ namespace NppDarkMode
|
|||||||
LRESULT onCtlColorSofter(HDC hdc);
|
LRESULT onCtlColorSofter(HDC hdc);
|
||||||
LRESULT onCtlColorDarker(HDC hdc);
|
LRESULT onCtlColorDarker(HDC hdc);
|
||||||
LRESULT onCtlColorError(HDC hdc);
|
LRESULT onCtlColorError(HDC hdc);
|
||||||
|
LRESULT onCtlColorDarkerBGStaticText(HDC hdc, bool isTextEnabled);
|
||||||
}
|
}
|
||||||
|
@ -3988,6 +3988,15 @@ intptr_t CALLBACK MultiInstanceSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_CTLCOLOREDIT:
|
||||||
|
{
|
||||||
|
if (NppDarkMode::isEnabled())
|
||||||
|
{
|
||||||
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_CTLCOLORDLG:
|
case WM_CTLCOLORDLG:
|
||||||
case WM_CTLCOLORSTATIC:
|
case WM_CTLCOLORSTATIC:
|
||||||
{
|
{
|
||||||
@ -4245,6 +4254,11 @@ intptr_t CALLBACK DelimiterSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
|
|
||||||
case WM_CTLCOLOREDIT:
|
case WM_CTLCOLOREDIT:
|
||||||
{
|
{
|
||||||
|
if (_tip)
|
||||||
|
{
|
||||||
|
NppDarkMode::setDarkTooltips(_tip, NppDarkMode::ToolTipsType::tooltip);
|
||||||
|
}
|
||||||
|
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
||||||
@ -4379,7 +4393,7 @@ intptr_t CALLBACK DelimiterSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
NppParameters& nppParams = NppParameters::getInstance();
|
NppParameters& nppParams = NppParameters::getInstance();
|
||||||
NppGUI & nppGUI = nppParams.getNppGUI();
|
NppGUI & nppGUI = nppParams.getNppGUI();
|
||||||
@ -4467,7 +4481,6 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
|
|||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE, BM_SETCHECK, roundBoxMode, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE, BM_SETCHECK, roundBoxMode, 0);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), linkEnable);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), linkEnable);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE), linkEnable);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE), linkEnable);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_STATIC), linkEnable);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), linkEnable);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), linkEnable);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4482,7 +4495,6 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
|
|||||||
}
|
}
|
||||||
|
|
||||||
case WM_CTLCOLORDLG:
|
case WM_CTLCOLORDLG:
|
||||||
case WM_CTLCOLORSTATIC:
|
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
@ -4491,6 +4503,12 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WM_CTLCOLORSTATIC:
|
||||||
|
{
|
||||||
|
bool isTextEnabled = isCheckedOrNot(IDC_CHECK_CLICKABLELINK_ENABLE) && ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam)) == IDC_URISCHEMES_STATIC;
|
||||||
|
return NppDarkMode::onCtlColorDarkerBGStaticText(reinterpret_cast<HDC>(wParam), isTextEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
case WM_PRINTCLIENT:
|
case WM_PRINTCLIENT:
|
||||||
{
|
{
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
@ -4551,9 +4569,10 @@ intptr_t CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, L
|
|||||||
}
|
}
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), isChecked);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE), isChecked);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE), isChecked);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_CLICKABLELINK_FULLBOXMODE), isChecked);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_STATIC), isChecked);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), isChecked);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), isChecked);
|
||||||
|
|
||||||
|
redraw();
|
||||||
|
|
||||||
nppGUI._styleURL = isChecked ? urlUnderLineFg : urlDisable;
|
nppGUI._styleURL = isChecked ? urlUnderLineFg : urlDisable;
|
||||||
HWND grandParent = ::GetParent(_hParent);
|
HWND grandParent = ::GetParent(_hParent);
|
||||||
::SendMessage(grandParent, NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0);
|
::SendMessage(grandParent, NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user