diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 4dba28f8f..5ec00c48e 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -286,7 +286,7 @@ IDI_READONLY_ALT_ICON ICON "icons/standard/tabbar/readonly_alt.ic IDI_MONITORING_ICON ICON "icons/standard/tabbar/monitoring.ico" IDI_MONITORING_DM_ICON ICON "icons/dark/tabbar/monitoring.ico" -IDI_FIND_RESULT_ICON ICON "icons/findResult.ico" +IDI_FIND_RESULT_ICON ICON "icons/standard/panels/tabbar/findResult.ico" IDC_DRAG_TAB CURSOR "cursors/drag.cur" IDC_DRAG_INTERDIT_TAB CURSOR "cursors/drag_interdit.cur" @@ -356,6 +356,8 @@ IDR_CLIPBOARDPANEL_ICO_DM ICON "icons/dark/panels/tabbar/clipboardP IDR_ASCIIPANEL_ICO ICON "icons/standard/panels/tabbar/asciiPanel.ico" IDR_ASCIIPANEL_ICO2 ICON "icons/light/panels/tabbar/asciiPanel.ico" IDR_ASCIIPANEL_ICO_DM ICON "icons/dark/panels/tabbar/asciiPanel.ico" +IDR_FIND_RESULT_ICO2 ICON "icons/light/panels/tabbar/findResult.ico" +IDR_FIND_RESULT_ICO_DM ICON "icons/dark/panels/tabbar/findResult.ico" IDI_PROJECT_WORKSPACE BITMAP "icons/standard/panels/treeview/project_work_space.bmp" diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index ae0f867f8..383a9f333 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -3507,6 +3507,8 @@ void FindReplaceDlg::findAllIn(InWhat op) bool justCreated = false; if (!_pFinder) { + NppParameters& nppParam = NppParameters::getInstance(); + _pFinder = new Finder(); _pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); _pFinder->setVolatiled(false); @@ -3517,8 +3519,14 @@ void FindReplaceDlg::findAllIn(InWhat op) // define the default docking behaviour data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO | DWS_USEOWNDARKMODE; + int icoID = IDI_FIND_RESULT_ICON; + if (NppDarkMode::isEnabled()) + icoID = IDR_FIND_RESULT_ICO_DM; + else if (nppParam.getNppGUI()._toolBarStatus != TB_STANDARD) + icoID = IDR_FIND_RESULT_ICO2; + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pFinder->getHSelf()); - DPIManagerV2::loadIcon(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + DPIManagerV2::loadIcon(_hInst, MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); data.pszAddInfo = _findAllResultStr; @@ -3528,7 +3536,7 @@ void FindReplaceDlg::findAllIn(InWhat op) // in this case is DOCKABLE_DEMO_INDEX data.dlgID = 0; - NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); + NativeLangSpeaker *pNativeSpeaker = nppParam.getNativeLangSpeaker(); generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-caption", TEXT("")); if (!text.empty()) @@ -3554,7 +3562,6 @@ void FindReplaceDlg::findAllIn(InWhat op) _pFinder->_scintView.execute(SCI_SETUSETABS, true); _pFinder->_scintView.execute(SCI_SETTABWIDTH, 4); - NppParameters& nppParam = NppParameters::getInstance(); NppGUI& nppGUI = nppParam.getNppGUI(); _pFinder->_longLinesAreWrapped = nppGUI._finderLinesAreCurrentlyWrapped; _pFinder->_scintView.wrap(_pFinder->_longLinesAreWrapped); @@ -3647,6 +3654,8 @@ void FindReplaceDlg::findAllIn(InWhat op) Finder * FindReplaceDlg::createFinder() { + NppParameters& nppParam = NppParameters::getInstance(); + Finder *pFinder = new Finder(); pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); @@ -3657,8 +3666,14 @@ Finder * FindReplaceDlg::createFinder() // define the default docking behaviour data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO | DWS_USEOWNDARKMODE; + int icoID = IDI_FIND_RESULT_ICON; + if (NppDarkMode::isEnabled()) + icoID = IDR_FIND_RESULT_ICO_DM; + else if (nppParam.getNppGUI()._toolBarStatus != TB_STANDARD) + icoID = IDR_FIND_RESULT_ICO2; + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pFinder->getHSelf()); - DPIManagerV2::loadIcon(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + DPIManagerV2::loadIcon(_hInst, MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); data.pszAddInfo = _findAllResultStr; @@ -3668,7 +3683,7 @@ Finder * FindReplaceDlg::createFinder() // in this case is DOCKABLE_DEMO_INDEX data.dlgID = 0; - NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); + NativeLangSpeaker *pNativeSpeaker = nppParam.getNativeLangSpeaker(); generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-caption", TEXT("")); if (!text.empty()) { diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index 30c566ebd..9b607ae18 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -119,10 +119,14 @@ public: updateCaption(); }; - void destroy() override{ + void destroy() override { for (auto& tTbData : _vTbData) { - ::DestroyIcon(tTbData->hIconTab); + if (tTbData->hIconTab != nullptr) + { + ::DestroyIcon(tTbData->hIconTab); + tTbData->hIconTab = nullptr; + } delete tTbData; } ::DestroyWindow(_hSelf); diff --git a/PowerEditor/src/icons/dark/panels/tabbar/findResult.ico b/PowerEditor/src/icons/dark/panels/tabbar/findResult.ico new file mode 100644 index 000000000..b1109a5fa Binary files /dev/null and b/PowerEditor/src/icons/dark/panels/tabbar/findResult.ico differ diff --git a/PowerEditor/src/icons/light/panels/tabbar/findResult.ico b/PowerEditor/src/icons/light/panels/tabbar/findResult.ico new file mode 100644 index 000000000..d8d8eae3d Binary files /dev/null and b/PowerEditor/src/icons/light/panels/tabbar/findResult.ico differ diff --git a/PowerEditor/src/icons/findResult.ico b/PowerEditor/src/icons/standard/panels/tabbar/findResult.ico similarity index 100% rename from PowerEditor/src/icons/findResult.ico rename to PowerEditor/src/icons/standard/panels/tabbar/findResult.ico diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index 60d05b97b..6da80e228 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -265,7 +265,6 @@ #define IDI_UNSAVED_DM_ICON 510 #define IDI_MONITORING_DM_ICON 511 #define IDI_READONLY_DM_ICON 512 -#define IDI_DELETE_ICON 525 #define IDI_PROJECT_WORKSPACE 601 @@ -374,6 +373,8 @@ #define IDR_CLIPBOARDPANEL_ICO_DM 1561 #define IDR_ASCIIPANEL_ICO2 1562 #define IDR_ASCIIPANEL_ICO_DM 1563 +#define IDR_FIND_RESULT_ICO2 1564 +#define IDR_FIND_RESULT_ICO_DM 1565 #define ID_MACRO 20000 // O .