mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-09-26 03:18:47 +02:00
parent
0dff45568b
commit
810ceacb49
@ -1766,6 +1766,8 @@ namespace NppDarkMode
|
|||||||
|
|
||||||
bool hasFocus = false;
|
bool hasFocus = false;
|
||||||
|
|
||||||
|
const bool isWindowEnabled = ::IsWindowEnabled(hWnd) == TRUE;
|
||||||
|
|
||||||
// CBS_DROPDOWN text is handled by parent by WM_CTLCOLOREDIT
|
// CBS_DROPDOWN text is handled by parent by WM_CTLCOLOREDIT
|
||||||
auto style = ::GetWindowLongPtr(hWnd, GWL_STYLE);
|
auto style = ::GetWindowLongPtr(hWnd, GWL_STYLE);
|
||||||
if ((style & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
|
if ((style & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST)
|
||||||
@ -1792,7 +1794,7 @@ namespace NppDarkMode
|
|||||||
auto index = static_cast<int>(::SendMessage(hWnd, CB_GETCURSEL, 0, 0));
|
auto index = static_cast<int>(::SendMessage(hWnd, CB_GETCURSEL, 0, 0));
|
||||||
if (index != CB_ERR)
|
if (index != CB_ERR)
|
||||||
{
|
{
|
||||||
::SetTextColor(hdc, NppDarkMode::getTextColor());
|
::SetTextColor(hdc, isWindowEnabled ? NppDarkMode::getTextColor() : NppDarkMode::getDisabledTextColor());
|
||||||
::SetBkColor(hdc, NppDarkMode::getBackgroundColor());
|
::SetBkColor(hdc, NppDarkMode::getBackgroundColor());
|
||||||
auto bufferLen = static_cast<size_t>(::SendMessage(hWnd, CB_GETLBTEXTLEN, index, 0));
|
auto bufferLen = static_cast<size_t>(::SendMessage(hWnd, CB_GETLBTEXTLEN, index, 0));
|
||||||
TCHAR* buffer = new TCHAR[(bufferLen + 1)];
|
TCHAR* buffer = new TCHAR[(bufferLen + 1)];
|
||||||
@ -1822,8 +1824,6 @@ namespace NppDarkMode
|
|||||||
|
|
||||||
bool isHot = ::PtInRect(&rc, ptCursor);
|
bool isHot = ::PtInRect(&rc, ptCursor);
|
||||||
|
|
||||||
bool isWindowEnabled = ::IsWindowEnabled(hWnd) == TRUE;
|
|
||||||
|
|
||||||
auto colorEnabledText = isHot ? NppDarkMode::getTextColor() : NppDarkMode::getDarkerTextColor();
|
auto colorEnabledText = isHot ? NppDarkMode::getTextColor() : NppDarkMode::getDarkerTextColor();
|
||||||
::SetTextColor(hdc, isWindowEnabled ? colorEnabledText : NppDarkMode::getDisabledTextColor());
|
::SetTextColor(hdc, isWindowEnabled ? colorEnabledText : NppDarkMode::getDisabledTextColor());
|
||||||
::SetBkColor(hdc, isHot ? NppDarkMode::getHotBackgroundColor() : NppDarkMode::getBackgroundColor());
|
::SetBkColor(hdc, isHot ? NppDarkMode::getHotBackgroundColor() : NppDarkMode::getBackgroundColor());
|
||||||
|
@ -88,6 +88,11 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WM_CTLCOLORLISTBOX:
|
||||||
|
{
|
||||||
|
return NppDarkMode::onCtlColor(reinterpret_cast<HDC>(wParam));
|
||||||
|
}
|
||||||
|
|
||||||
case WM_CTLCOLORDLG:
|
case WM_CTLCOLORDLG:
|
||||||
{
|
{
|
||||||
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
|
||||||
@ -100,7 +105,8 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
|
|
||||||
bool isStaticText = (dlgCtrlID == IDC_COL_INITNUM_STATIC ||
|
bool isStaticText = (dlgCtrlID == IDC_COL_INITNUM_STATIC ||
|
||||||
dlgCtrlID == IDC_COL_INCRNUM_STATIC ||
|
dlgCtrlID == IDC_COL_INCRNUM_STATIC ||
|
||||||
dlgCtrlID == IDC_COL_REPEATNUM_STATIC);
|
dlgCtrlID == IDC_COL_REPEATNUM_STATIC ||
|
||||||
|
dlgCtrlID == IDC_COL_LEADING_STATIC);
|
||||||
//set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text
|
//set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text
|
||||||
if (isStaticText)
|
if (isStaticText)
|
||||||
{
|
{
|
||||||
@ -154,8 +160,8 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR
|
|||||||
{
|
{
|
||||||
(*_ppEditView)->execute(SCI_BEGINUNDOACTION);
|
(*_ppEditView)->execute(SCI_BEGINUNDOACTION);
|
||||||
|
|
||||||
const int stringSize = 1024;
|
constexpr int stringSize = 1024;
|
||||||
TCHAR str[stringSize];
|
TCHAR str[stringSize]{};
|
||||||
|
|
||||||
bool isTextMode = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_GETCHECK, 0, 0));
|
bool isTextMode = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_TEXT_RADIO, BM_GETCHECK, 0, 0));
|
||||||
|
|
||||||
@ -467,7 +473,6 @@ void ColumnEditorDlg::switchTo(bool toText)
|
|||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_HEX_RADIO), !toText);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_HEX_RADIO), !toText);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_OCT_RADIO), !toText);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_OCT_RADIO), !toText);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_BIN_RADIO), !toText);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_BIN_RADIO), !toText);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_LEADING_STATIC), !toText);
|
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_LEADING_COMBO), !toText);
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_COL_LEADING_COMBO), !toText);
|
||||||
|
|
||||||
::SetFocus(toText?hText:hNum);
|
::SetFocus(toText?hText:hNum);
|
||||||
@ -475,6 +480,7 @@ void ColumnEditorDlg::switchTo(bool toText)
|
|||||||
redrawDlgItem(IDC_COL_INITNUM_STATIC);
|
redrawDlgItem(IDC_COL_INITNUM_STATIC);
|
||||||
redrawDlgItem(IDC_COL_INCRNUM_STATIC);
|
redrawDlgItem(IDC_COL_INCRNUM_STATIC);
|
||||||
redrawDlgItem(IDC_COL_REPEATNUM_STATIC);
|
redrawDlgItem(IDC_COL_REPEATNUM_STATIC);
|
||||||
|
redrawDlgItem(IDC_COL_LEADING_STATIC);
|
||||||
|
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user