diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 7b9c2124f..e6d8ac33b 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -7203,7 +7203,7 @@ void Notepad_plus::launchClipboardHistoryPanel() NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {}; + tTbData data{}; _pClipboardHistoryPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pClipboardHistoryPanel->getHSelf())); @@ -7216,7 +7216,9 @@ void Notepad_plus::launchClipboardHistoryPanel() else if (nppParams.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_CLIPBOARDPANEL_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pClipboardHistoryPanel->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7265,7 +7267,7 @@ void Notepad_plus::launchDocumentListPanel(bool changeFromBtnCmd) _pDocumentListPanel->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), hImgLst); NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {}; + tTbData data{}; _pDocumentListPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pDocumentListPanel->getHSelf())); @@ -7278,7 +7280,9 @@ void Notepad_plus::launchDocumentListPanel(bool changeFromBtnCmd) else if (nppParams.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_DOCLIST_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pDocumentListPanel->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7351,7 +7355,7 @@ void Notepad_plus::launchAnsiCharPanel() NativeLangSpeaker *pNativeSpeaker = nppParams.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {}; + tTbData data{}; _pAnsiCharPanel->create(&data, isRTL); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pAnsiCharPanel->getHSelf())); @@ -7364,7 +7368,9 @@ void Notepad_plus::launchAnsiCharPanel() else if (nppParams.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_ASCIIPANEL_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pAnsiCharPanel->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7398,7 +7404,7 @@ void Notepad_plus::launchFileBrowser(const vector & folders, con _pFileBrowser = new FileBrowser; _pFileBrowser->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf()); - tTbData data = {}; + tTbData data{}; _pFileBrowser->create(&data, _nativeLangSpeaker.isRTL()); data.pszName = TEXT("ST"); @@ -7414,7 +7420,9 @@ void Notepad_plus::launchFileBrowser(const vector & folders, con else if (nppParams.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_FILEBROWSER_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pFileBrowser->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7508,7 +7516,7 @@ void Notepad_plus::launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel, int (*pProjPanel)->setWorkSpaceFilePath(nppParam.getWorkSpaceFilePath(panelID)); NativeLangSpeaker *pNativeSpeaker = nppParam.getNativeLangSpeaker(); bool isRTL = pNativeSpeaker->isRTL(); - tTbData data = {}; + tTbData data{}; (*pProjPanel)->create(&data, isRTL); data.pszName = TEXT("ST"); @@ -7522,7 +7530,9 @@ void Notepad_plus::launchProjectPanel(int cmdID, ProjectPanel ** pProjPanel, int else if (nppParam.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_PROJECTPANEL_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, (*pProjPanel)->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7573,7 +7583,7 @@ void Notepad_plus::launchDocMap() _pDocMap = new DocumentMap(); _pDocMap->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView); - tTbData data = {}; + tTbData data{}; _pDocMap->create(&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pDocMap->getHSelf())); @@ -7586,7 +7596,9 @@ void Notepad_plus::launchDocMap() else if (nppParam.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_DOCMAP_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pDocMap->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is @@ -7620,7 +7632,7 @@ void Notepad_plus::launchFunctionList() _pFuncList = new FunctionListPanel(); _pFuncList->init(_pPublicInterface->getHinst(), _pPublicInterface->getHSelf(), &_pEditView); - tTbData data = {}; + tTbData data{}; _pFuncList->create(&data); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pFuncList->getHSelf())); @@ -7635,7 +7647,9 @@ void Notepad_plus::launchFunctionList() else if (nppParam.getNppGUI()._toolBarStatus != TB_STANDARD) icoID = IDR_FUNC_LIST_ICO2; - data.hIconTab = (HICON)::LoadImage(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), IMAGE_ICON, 14, 14, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + const int iconSize = DPIManagerV2::scale(g_dockingContTabIconSize, _pFuncList->getHSelf()); + DPIManagerV2::loadIcon(_pPublicInterface->getHinst(), MAKEINTRESOURCE(icoID), iconSize, iconSize, &data.hIconTab, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + data.pszModuleName = NPP_INTERNAL_FUCTION_STR; // the dlgDlg should be the index of funcItem where the current function pointer is diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 821d22824..834214cf2 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -3509,12 +3509,15 @@ void FindReplaceDlg::findAllIn(InWhat op) _pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); _pFinder->setVolatiled(false); - tTbData data = {}; + tTbData data{}; _pFinder->create(&data); ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_pFinder->getHSelf())); // define the default docking behaviour data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO | DWS_USEOWNDARKMODE; - data.hIconTab = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), IMAGE_ICON, 0, 0, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + + 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); + data.pszAddInfo = _findAllResultStr; data.pszModuleName = NPP_INTERNAL_FUCTION_STR; @@ -3645,13 +3648,16 @@ Finder * FindReplaceDlg::createFinder() Finder *pFinder = new Finder(); pFinder->init(_hInst, (*_ppEditView)->getHParent(), _ppEditView); - tTbData data = {}; + tTbData data{}; bool isRTL = _pFinder->_scintView.isTextDirectionRTL(); pFinder->create(&data, isRTL); ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(pFinder->getHSelf())); // define the default docking behaviour data.uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB | DWS_ADDINFO | DWS_USEOWNDARKMODE; - data.hIconTab = (HICON)::LoadImage(_hInst, MAKEINTRESOURCE(IDI_FIND_RESULT_ICON), IMAGE_ICON, 0, 0, LR_LOADMAP3DCOLORS | LR_LOADTRANSPARENT); + + 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); + data.pszAddInfo = _findAllResultStr; data.pszModuleName = NPP_INTERNAL_FUCTION_STR; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index 9b97862fa..87ff08d1c 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -42,6 +42,7 @@ enum eMousePos { #define CLOSEBTN_POS_LEFT 3 #define CLOSEBTN_POS_TOP 3 +constexpr int g_dockingContTabIconSize = 14; class DockingCont : public StaticDialog { diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp index a80ac7218..c2d783c91 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp @@ -591,7 +591,7 @@ void DockingManager::createDockableDlg(tTbData data, int iCont, bool isVisible) // create image list if not exist if (_hImageList == NULL) { - int iconDpiDynamicalSize = NppParameters::getInstance()._dpiManager.scaleY(12) + 2; + const int iconDpiDynamicalSize = DPIManagerV2::scale(g_dockingContTabIconSize, data.hClient); _hImageList = ::ImageList_Create(iconDpiDynamicalSize, iconDpiDynamicalSize, ILC_COLOR32 | ILC_MASK, 0, 0); }