From b3179b5ccbf2b332f11d5f95f7baf918933facd4 Mon Sep 17 00:00:00 2001 From: Alan Kilborn Date: Sat, 7 Oct 2023 08:16:45 -0400 Subject: [PATCH] Dark mode tweaks and unicode size support for InSelection configurable size Followup PR to #14175 Addresses * https://github.com/notepad-plus-plus/notepad-plus-plus/pull/14175#issuecomment-1751439227 and * https://github.com/notepad-plus-plus/notepad-plus-plus/commit/591b00e538052543376e937a220aa6ef024ed10b#commitcomment-129354863 Close #14217 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 2 +- PowerEditor/src/WinControls/Preference/preferenceDlg.cpp | 3 +++ PowerEditor/src/WinControls/Preference/preferenceDlg.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 6036c9b7c..25aa0c28b 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1493,7 +1493,7 @@ intptr_t CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA if (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE) { Sci_CharacterRangeFull cr = (*_ppEditView)->getSelection(); - intptr_t nbSelected = cr.cpMax - cr.cpMin; + intptr_t nbSelected = (*_ppEditView)->execute(SCI_COUNTCHARACTERS, cr.cpMin, cr.cpMax); bool inSelEnabled = nbSelected != 0; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index e9c415569..a3ede00de 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -247,6 +247,8 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM NppDarkMode::setDarkTooltips(_delimiterSubDlg._tip, NppDarkMode::ToolTipsType::tooltip); if (_performanceSubDlg._largeFileRestrictionTip != nullptr) NppDarkMode::setDarkTooltips(_performanceSubDlg._largeFileRestrictionTip, NppDarkMode::ToolTipsType::tooltip); + if (_searchingSubDlg._tipInSelThresh != nullptr) + NppDarkMode::setDarkTooltips(_searchingSubDlg._tipInSelThresh, NppDarkMode::ToolTipsType::tooltip); // groupbox label in dark mode support disabled text color if (NppDarkMode::isEnabled()) @@ -5595,6 +5597,7 @@ intptr_t CALLBACK SearchingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR case WM_CTLCOLORDLG: case WM_CTLCOLORSTATIC: + case WM_CTLCOLOREDIT: { return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index 54c6c675a..917cfdc64 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -176,6 +176,7 @@ private : class SearchingSubDlg : public StaticDialog { +friend class PreferenceDlg; public: SearchingSubDlg() = default; ~SearchingSubDlg() {