Add new plugin notification: NPPN_TOOLBARICONSETCHANGED

Fix #16646, close #16647
This commit is contained in:
Shridhar Kumar 2025-06-08 18:02:09 -04:00 committed by Don Ho
parent b81e38ef60
commit 76b1cba609
2 changed files with 13 additions and 6 deletions

View File

@ -1248,3 +1248,10 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
//scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED;
//scnNotification->nmhdr.hwndFrom = hwndNpp
//scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero
#define NPPN_TOOLBARICONSETCHANGED (NPPN_FIRST + 32) // To notify plugins that toolbar icon set selection has changed
//scnNotification->nmhdr.code = NPPN_TOOLBARICONSETCHANGED;
//scnNotification->nmhdr.hwndFrom = hwndNpp;
//scnNotification->nmhdr.idFrom = iconSetChoice;
// where iconSetChoice could be 1 of 5 possible values:
// 0 (Fluent UI: small), 1 (Fluent UI: large), 2 (Filled Fluent UI: small), 3 (Filled Fluent UI: large) and 4 (Standard icons: small).

View File

@ -378,12 +378,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_INTERNAL_TOOLBARICONSCHANGED:
{
refreshInternalPanelIcons();
// Notify plugins that toolbar icons have changed TODO
//SCNotification scnN{};
//scnN.nmhdr.code = ;
//scnN.nmhdr.hwndFrom = hwnd;
//scnN.nmhdr.idFrom = 0;
//_pluginsManager.notify(&scnN);
// Notify plugins that toolbar icons have changed
SCNotification scnN{};
scnN.nmhdr.code = NPPN_TOOLBARICONSETCHANGED;
scnN.nmhdr.hwndFrom = hwnd;
scnN.nmhdr.idFrom = _toolBar.getState();
_pluginsManager.notify(&scnN);
return TRUE;
}