diff --git a/PowerEditor/src/NppDarkMode.cpp b/PowerEditor/src/NppDarkMode.cpp index b4ede8cb2..590b29589 100644 --- a/PowerEditor/src/NppDarkMode.cpp +++ b/PowerEditor/src/NppDarkMode.cpp @@ -1766,6 +1766,8 @@ namespace NppDarkMode bool hasFocus = false; + const bool isWindowEnabled = ::IsWindowEnabled(hWnd) == TRUE; + // CBS_DROPDOWN text is handled by parent by WM_CTLCOLOREDIT auto style = ::GetWindowLongPtr(hWnd, GWL_STYLE); if ((style & CBS_DROPDOWNLIST) == CBS_DROPDOWNLIST) @@ -1792,7 +1794,7 @@ namespace NppDarkMode auto index = static_cast(::SendMessage(hWnd, CB_GETCURSEL, 0, 0)); if (index != CB_ERR) { - ::SetTextColor(hdc, NppDarkMode::getTextColor()); + ::SetTextColor(hdc, isWindowEnabled ? NppDarkMode::getTextColor() : NppDarkMode::getDisabledTextColor()); ::SetBkColor(hdc, NppDarkMode::getBackgroundColor()); auto bufferLen = static_cast(::SendMessage(hWnd, CB_GETLBTEXTLEN, index, 0)); TCHAR* buffer = new TCHAR[(bufferLen + 1)]; @@ -1822,8 +1824,6 @@ namespace NppDarkMode bool isHot = ::PtInRect(&rc, ptCursor); - bool isWindowEnabled = ::IsWindowEnabled(hWnd) == TRUE; - auto colorEnabledText = isHot ? NppDarkMode::getTextColor() : NppDarkMode::getDarkerTextColor(); ::SetTextColor(hdc, isWindowEnabled ? colorEnabledText : NppDarkMode::getDisabledTextColor()); ::SetBkColor(hdc, isHot ? NppDarkMode::getHotBackgroundColor() : NppDarkMode::getBackgroundColor()); diff --git a/PowerEditor/src/ScintillaComponent/columnEditor.cpp b/PowerEditor/src/ScintillaComponent/columnEditor.cpp index 38f4f22f4..a55d29fc7 100644 --- a/PowerEditor/src/ScintillaComponent/columnEditor.cpp +++ b/PowerEditor/src/ScintillaComponent/columnEditor.cpp @@ -88,6 +88,11 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); } + case WM_CTLCOLORLISTBOX: + { + return NppDarkMode::onCtlColor(reinterpret_cast(wParam)); + } + case WM_CTLCOLORDLG: { return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); @@ -100,7 +105,8 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR bool isStaticText = (dlgCtrlID == IDC_COL_INITNUM_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 if (isStaticText) { @@ -154,8 +160,8 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR { (*_ppEditView)->execute(SCI_BEGINUNDOACTION); - const int stringSize = 1024; - TCHAR str[stringSize]; + constexpr int stringSize = 1024; + TCHAR str[stringSize]{}; 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_OCT_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); ::SetFocus(toText?hText:hNum); @@ -475,6 +480,7 @@ void ColumnEditorDlg::switchTo(bool toText) redrawDlgItem(IDC_COL_INITNUM_STATIC); redrawDlgItem(IDC_COL_INCRNUM_STATIC); redrawDlgItem(IDC_COL_REPEATNUM_STATIC); + redrawDlgItem(IDC_COL_LEADING_STATIC); if (NppDarkMode::isEnabled()) { @@ -483,7 +489,7 @@ void ColumnEditorDlg::switchTo(bool toText) } } -UCHAR ColumnEditorDlg::getFormat() +UCHAR ColumnEditorDlg::getFormat() { UCHAR f = 0; // Dec by default if (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_COL_HEX_RADIO, BM_GETCHECK, 0, 0)) @@ -519,4 +525,4 @@ ColumnEditorParam::leadingChoice ColumnEditorDlg::getLeading() } } return leading; -} \ No newline at end of file +}